Skip to content

Commit 19c6657

Browse files
committed
Fix derivedNames test on Windows
On Windows, both outcomes are possible. It might be related to JDK version on Windows.
1 parent 6568540 commit 19c6657

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/generic-java-signatures/derivedNames.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ object Test {
44
def main(args: Array[String]): Unit = {
55
val objectB = classOf[Foo[Any]].getClasses
66
val returnType = objectB(1).getDeclaredMethod("m").getGenericReturnType.asInstanceOf[ParameterizedType]
7+
val out1 = "Test$Foo.Test$Foo$A<Test.Test$Foo<T1>.B$>" // Windows and OSX
8+
val out2 = "Test$Foo$A<Test$Foo<T1>$B$>" // Linux and sometimes Windows
79
if (scala.util.Properties.isWin)
8-
assert(returnType.toString == "Test$Foo.Test$Foo$A<Test.Test$Foo<T1>.B$>")
10+
assert(returnType.toString == out1 || returnType.toString == out2)
911
else
10-
assert(returnType.toString == "Test$Foo$A<Test$Foo<T1>$B$>")
12+
assert(returnType.toString == out2)
1113
}
1214
class Foo[T1] {
1315
class A[T2]

0 commit comments

Comments
 (0)