diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/takeAndDrop.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/takeAndDrop.scala b/test/files/run/takeAndDrop.scala new file mode 100644 index 0000000000..896923ddc1 --- /dev/null +++ b/test/files/run/takeAndDrop.scala @@ -0,0 +1,14 @@ +object Test { + def main(args: Array[String]): Unit = { + val range = 1 to 10 + val target = (3 to 8).toList + val confirm = (xs: Seq[Int]) => assert(xs.toList == target) + + confirm(range drop 2 dropRight 2) + confirm(range drop 1 dropRight 1 drop 1 dropRight 1) + confirm(range take 8 drop 2) + confirm(range takeRight 8 dropRight 2) + confirm(range drop 2 take 6) + confirm(range dropRight 1 take 8 takeRight 7 drop 1) + } +} |