diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t1323.check | 18 | ||||
-rw-r--r-- | test/files/run/t1323.scala | 25 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/files/run/t1323.check b/test/files/run/t1323.check new file mode 100644 index 0000000000..0d540f71b5 --- /dev/null +++ b/test/files/run/t1323.check @@ -0,0 +1,18 @@ + 1:-1 + 2:0 + 3:1 + 4:2 + 5:-1 + 6:-1 + 7:-1 + 8:-1 + 9:-1 +10:0 +11:-1 +12:-1 +13:-1 +14:0 +15:0 +16:-1 +17:-1 +18:3 diff --git a/test/files/run/t1323.scala b/test/files/run/t1323.scala new file mode 100644 index 0000000000..7a68482101 --- /dev/null +++ b/test/files/run/t1323.scala @@ -0,0 +1,25 @@ +object Test extends Application { + println(" 1:" + List(1,2,3,4).indexOf(List(0,1))) // -1 + println(" 2:" + List(1,2,3,4).indexOf(List(1,2))) // 0 + println(" 3:" + List(1,2,3,4).indexOf(List(2,3))) // 1 + println(" 4:" + List(1,2,3,4).indexOf(List(3,4))) // 2 + println(" 5:" + List(1,2,3,4).indexOf(List(4,5))) // -1 + println(" 6:" + List(1,2,3,4).indexOf(List(2,4))) // -1 + println(" 7:" + List(1,2,3,4).indexOf(List(4,3))) // -1 + println(" 8:" + List(1,2,3,4).indexOf(List(1,3))) // -1 + println(" 9:" + List(1,2,3,4).indexOf(List(1,3))) // -1 + println("10:" + List(1,2,3,4).indexOf(List(1,2,3,4))) // 0 + println("11:" + List(1,2,3,4).indexOf(List(4,3,2,1))) // -1 + println("12:" + List(1,2,3,4).indexOf(List(1,2,3,4,5))) // -1 + println("13:" + List(1,2,3,4).indexOf(List(5,4,3,2,1))) // -1 + println("14:" + List(1,2,3,4).indexOf(List())) // 0 + println("15:" + List().indexOf(List())) // 0 + println("16:" + List().indexOf(List(1,2,3,4))) // -1 + + // Do some testing with infinite sequences + def from(n: Int): Stream[Int] = Stream.cons(n, from(n + 1)) + + println("17:" + List(1,2,3,4).indexOf(from(1))) // -1 + println("18:" + from(1).indexOf(List(4,5,6))) // 3 +} + |