diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-27 18:01:40 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-27 18:01:40 +0000 |
commit | 649b4262c4483f12ec4d82549b9860e2f88d33b8 (patch) | |
tree | 6cd9e426471e7827223589717d6ae51c54884bc1 /test | |
parent | 3efce112b5759c04566055b8418261d13e474e1e (diff) | |
download | scala-649b4262c4483f12ec4d82549b9860e2f88d33b8.tar.gz scala-649b4262c4483f12ec4d82549b9860e2f88d33b8.tar.bz2 scala-649b4262c4483f12ec4d82549b9860e2f88d33b8.zip |
Fixed bug in Sorted "to" not using the ordering.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t4930.check | 2 | ||||
-rw-r--r-- | test/files/run/t4930.scala | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/t4930.check b/test/files/run/t4930.check new file mode 100644 index 0000000000..a58efd4685 --- /dev/null +++ b/test/files/run/t4930.check @@ -0,0 +1,2 @@ +List(1) +List(1) diff --git a/test/files/run/t4930.scala b/test/files/run/t4930.scala new file mode 100644 index 0000000000..775f627948 --- /dev/null +++ b/test/files/run/t4930.scala @@ -0,0 +1,11 @@ +import collection.immutable.SortedMap + +object Test { + implicit val ord: Ordering[Array[Byte]] = Ordering.by((_: Array[Byte]).toIterable) + + def main(args: Array[String]): Unit = { + val m = SortedMap(Array[Byte](1) -> 0) + println(m.to(Array[Byte](1)) flatMap (_._1.mkString)) + println(m.from(Array[Byte](1)) flatMap (_._1.mkString)) + } +} |