Permalink
Browse files

SI-7258 Don't assume order of reflection values in t6223

test/files/run/t6223's check file expects a specific
ordering of the reflected values. The ordering is not
guaranteed by the runtime/reflection API and can change.

Therefore, sort the values before comparing them.
  • Loading branch information...
1 parent b7b4f87 commit ef85a105bd958e4f925fa524d15f8e63d5f4c1a9 @soc soc committed Mar 15, 2013
Showing with 3 additions and 3 deletions.
  1. +1 −1 test/files/run/t6223.check
  2. +2 −2 test/files/run/t6223.scala
@@ -1,4 +1,4 @@
bar
-bar$mcI$sp
bar$mIc$sp
bar$mIcI$sp
+bar$mcI$sp
@@ -5,7 +5,7 @@ class Foo[@specialized(Int) A](a:A) {
object Test {
def main(args:Array[String]) {
val f = new Foo(333)
- val ms = f.getClass().getDeclaredMethods()
- ms.foreach(m => println(m.getName))
+ val ms = f.getClass().getDeclaredMethods().map(_.getName).sorted
+ ms.foreach(println)
}
}

0 comments on commit ef85a10

Please sign in to comment.