summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-06-04 14:32:46 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-06-04 14:32:46 +0000
commit38d7917431282455c493802599c79ca4647fcab4 (patch)
tree9144a911d44da15cea3c5fed568f6e2201d3603b /test/files
parent3d637ac989d965b8f76e4f4db2a61aa4a5d9a945 (diff)
downloadscala-38d7917431282455c493802599c79ca4647fcab4.tar.gz
scala-38d7917431282455c493802599c79ca4647fcab4.tar.bz2
scala-38d7917431282455c493802599c79ca4647fcab4.zip
Merged revisions 22115,22154-22155,22157,22159-...
Merged revisions 22115,22154-22155,22157,22159-22161 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r22115 | extempore | 2010-06-01 19:44:33 +0200 (Tue, 01 Jun 2010) | 1 line Make Iterator.toStream be properly lazy. Closes #3516, review by prokopec. ........ r22154 | extempore | 2010-06-03 19:58:27 +0200 (Thu, 03 Jun 2010) | 6 lines Restored Source factories to a form source compatible with 2.7.7. No default implicit arguments, now low priority saves the day with a low priority codec which io.Codec offers as last resort. Dropped the line separator argument to getLines and made it act in a separator agnostic way (any of \r\n, \r, or \n is a separator.) Review by community. ........ r22155 | extempore | 2010-06-03 20:55:18 +0200 (Thu, 03 Jun 2010) | 2 lines Codec changes in scala.tools.nsc.io corresponding to those made in r22154. No review. ........ r22157 | extempore | 2010-06-03 22:25:32 +0200 (Thu, 03 Jun 2010) | 3 lines Sorted out some buck passing among TraversableOnce and its subclasses about how exactly one creates a Stream. This is a continuation of r22115 for #3516. Review by prokopec. ........ r22159 | extempore | 2010-06-04 04:39:10 +0200 (Fri, 04 Jun 2010) | 4 lines Reverts r21973, the patch I characterized as "hacky but no-risk" in my commit message, for causing #3480. Closes #3480. I'd say no review but who can trust a guy who throws around "no risk" with such abandon. ........ r22160 | extempore | 2010-06-04 07:03:51 +0200 (Fri, 04 Jun 2010) | 10 lines Discovered and disproved this unlikely truth: scala> (1 to 1 drop 1) == (1 to 1) res0: Boolean = true It was introduced in r21349 which was to fix #2535, but led to #3529. I humbly suggest we can't afford to introduce bugs of this severity in the pursuit of corner cases such as Ranges which use Int.MaxValue as a boundary. And looking at the patch I find the "after" code a lot harder to follow. Closes #3529. Review by prokopec. ........ r22161 | extempore | 2010-06-04 07:16:08 +0200 (Fri, 04 Jun 2010) | 4 lines Burned by a last minute adjustment, I lost the downward counting direction. It is a seriously fiddly process to adjust Range and I don't recommend it to anyone. Closes #3529 over again. Review by prokopec. ........
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/unittest_io.scala2
-rw-r--r--test/files/neg/bug3189.check7
-rw-r--r--test/files/neg/bug3189.scala3
-rw-r--r--test/files/pos/bug3480.scala4
-rw-r--r--test/files/run/bug3516.check3
-rw-r--r--test/files/run/bug3516.scala13
-rw-r--r--test/files/run/bug3529.scala14
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)
+ }
+}