diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/unittest_io.scala | 2 | ||||
-rw-r--r-- | test/files/neg/bug3189.check | 7 | ||||
-rw-r--r-- | test/files/neg/bug3189.scala | 3 | ||||
-rw-r--r-- | test/files/pos/bug3480.scala | 4 | ||||
-rw-r--r-- | test/files/run/bug3516.check | 3 | ||||
-rw-r--r-- | test/files/run/bug3516.scala | 13 | ||||
-rw-r--r-- | test/files/run/bug3529.scala | 14 |
7 files changed, 35 insertions, 11 deletions
diff --git a/test/files/jvm/unittest_io.scala b/test/files/jvm/unittest_io.scala index 80d33d8433..fd5889cb86 100644 --- a/test/files/jvm/unittest_io.scala +++ b/test/files/jvm/unittest_io.scala @@ -15,7 +15,7 @@ it is split on several lines. isn't it? """) - def runTest() = assertEquals("wrong number of lines",src.getLines("\n").toList.length,5) // five new lines in there + def runTest() = assertEquals("wrong number of lines",src.getLines.toList.length,5) // five new lines in there //for (line <- src.getLines) { // Console.print(line) //} diff --git a/test/files/neg/bug3189.check b/test/files/neg/bug3189.check deleted file mode 100644 index 520644fd43..0000000000 --- a/test/files/neg/bug3189.check +++ /dev/null @@ -1,7 +0,0 @@ -bug3189.scala:2: error: illegal start of simple pattern - val Array(a,b*) = ("": Any) - ^ -bug3189.scala:3: error: ')' expected but '}' found. -} -^ -two errors found diff --git a/test/files/neg/bug3189.scala b/test/files/neg/bug3189.scala deleted file mode 100644 index 4ea4bb7581..0000000000 --- a/test/files/neg/bug3189.scala +++ /dev/null @@ -1,3 +0,0 @@ -object A { - val Array(a,b*) = ("": Any) -}
\ No newline at end of file diff --git a/test/files/pos/bug3480.scala b/test/files/pos/bug3480.scala new file mode 100644 index 0000000000..830365170b --- /dev/null +++ b/test/files/pos/bug3480.scala @@ -0,0 +1,4 @@ +object Test { + val List(_*) = List(1) + val Array( who, what @ _* ) = "Eclipse plugin cannot not handle this" split (" ") +} diff --git a/test/files/run/bug3516.check b/test/files/run/bug3516.check new file mode 100644 index 0000000000..d0d10d82fa --- /dev/null +++ b/test/files/run/bug3516.check @@ -0,0 +1,3 @@ +1 +1 +21 diff --git a/test/files/run/bug3516.scala b/test/files/run/bug3516.scala new file mode 100644 index 0000000000..aa302ce85a --- /dev/null +++ b/test/files/run/bug3516.scala @@ -0,0 +1,13 @@ +object Test { + def mkIterator = (1 to 5).iterator map (x => { println(x) ; x }) + def mkInfinite = Iterator continually { println(1) ; 1 } + + def main(args: Array[String]): Unit = { + // Stream is strict in its head so we should see 1 from each of them. + val s1 = mkIterator.toStream + val s2 = mkInfinite.toStream + // back and forth without slipping into nontermination. + println((Stream from 1).toIterator.drop(10).toStream.drop(10).toIterator.next) + () + } +} diff --git a/test/files/run/bug3529.scala b/test/files/run/bug3529.scala new file mode 100644 index 0000000000..bb82424bf6 --- /dev/null +++ b/test/files/run/bug3529.scala @@ -0,0 +1,14 @@ +object Test { + def main(args: Array[String]): Unit = { + assert(1 to 10 drop 10 isEmpty) + assert(1 until 10 drop 9 isEmpty) + assert(1 to 10 by 2 drop 5 isEmpty) + assert(10 to 1 by -1 drop 10 isEmpty) + assert((10 to 1 by -1 drop 9) == Seq(1)) + + assert((1 to 10 drop 9) == Seq(10)) + assert((1 until 10 drop 9) == Nil) + + assert(Stream(1 to 10).flatten.toList == Stream(1 until 11).flatten.toList) + } +} |