You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing line separator in a generated kotlin file #842
funmethodThrowingException1() {
val array =Array<Int>(1) { 1 };
val a = array[2]
}
funmethodThrowingException2() {
val array:Array<Int>?=nullval a = array!![1]
}
Generated results:
№1
@TestfuntestMethodThrowingException11() {
valsimpleClass = SimpleClass()
/* This test fails because method [SimpleClass.methodThrowingException1] produces [java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 1] SimpleClass.methodThrowingException1(SimpleClass.java:4) */simpleClass.methodThrowingException1()
}
@TestfuntestMethodThrowingException31() {
valsimpleClass = SimpleClass()
/* This test fails because method [SimpleClass.methodThrowingException3] produces [java.lang.NullPointerException] SimpleClass.methodThrowingException3(SimpleClass.java:9) */simpleClass.methodThrowingException3()
}
№2
@Test
funtestMethodThrowingException11() {
val a =A()
/* This test fails because method [A.methodThrowingException1] produces [java.lang.ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 1] A.methodThrowingException1(Main.kt:4) */
a.methodThrowingException1()
}
@Test
funtestMethodThrowingException21() {
val a =A()
/* This test fails because method [A.methodThrowingException2] produces [java.lang.NullPointerException] A.methodThrowingException2(Main.kt:9) */
a.methodThrowingException2()
}
Activity
tyuldashev commentedon Oct 28, 2022
There is bigger problem with javadoc formatting, does dedicated issue is required?


as result displayed as
EgorkaKulikov commentedon Nov 11, 2022
Actually this issue may be irrelevant because kotlin docs are now disabled.
sofurihafe commentedon Nov 11, 2022
Just tried to reproduce the problem with the following java & kotlin code samples. The missing line separator is present for both of them.
Code to generate tests for:
№1
№2
Generated results:
№1
№2