diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/OrderingTest.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/run/OrderingTest.scala b/test/files/run/OrderingTest.scala index 49953b22d0..fee15fc2f9 100644 --- a/test/files/run/OrderingTest.scala +++ b/test/files/run/OrderingTest.scala @@ -28,4 +28,9 @@ object Test extends Application { testAll[Iterable[Int]](List(1, 2), List(2)); testAll((1, "bar"), (1, "foo")) testAll((1, "foo"), (2, "bar")) + + // sortBy + val words = "The quick brown fox jumped over the lazy dog".split(' ') + val result = words.sortBy(x => (x.length, x.head)) + assert(result sameElements Array[String]("The", "dog", "fox", "the", "lazy", "over", "brown", "quick", "jumped")) } |