diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-18 05:50:26 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-18 05:50:26 -0700 |
commit | 2e34310cb1c82d8589d7c222d9d7c9352f3e944b (patch) | |
tree | a48446cddb796ed1c7a724bfcf2786ccc9287bbe /test/files/run | |
parent | 1e68d3b521cc968fa0ad1ef535d1ac0abcaa024d (diff) | |
parent | 41869c39ba68ef574595533777d2a99fcabdbdc3 (diff) | |
download | scala-2e34310cb1c82d8589d7c222d9d7c9352f3e944b.tar.gz scala-2e34310cb1c82d8589d7c222d9d7c9352f3e944b.tar.bz2 scala-2e34310cb1c82d8589d7c222d9d7c9352f3e944b.zip |
Merge pull request #903 from S714726/SI-5906
SI-5906 Search for sorted sequences
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/search.check | 6 | ||||
-rw-r--r-- | test/files/run/search.scala | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/search.check b/test/files/run/search.check new file mode 100644 index 0000000000..a885696509 --- /dev/null +++ b/test/files/run/search.check @@ -0,0 +1,6 @@ +Found(2) +Found(4) +InsertionPoint(9) +Found(2) +Found(4) +InsertionPoint(9) diff --git a/test/files/run/search.scala b/test/files/run/search.scala new file mode 100644 index 0000000000..ed7fed54a7 --- /dev/null +++ b/test/files/run/search.scala @@ -0,0 +1,14 @@ +object Test extends App { + import scala.collection.{LinearSeq, IndexedSeq} + import scala.collection.Searching.search + + val ls = LinearSeq(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13) + println(ls.search(3)) + println(ls.search(5, 3, 8)) + println(ls.search(12)) + + val is = IndexedSeq(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13) + println(is.search(3)) + println(is.search(5, 3, 8)) + println(is.search(12)) +} |