Skip to content

Commit 741c4d1

Browse files
committed
Update tests for 2.13 stdlib changes
For the tests that were originally copied from scalac, I also copied the updated version if one existed, or removed it if they had removed it. i3518 has to be disabled because using scala.Unit is marked @compileTimeOnly and dotty crashes on @compileTimeOnly right now.
1 parent 0099330 commit 741c4d1

File tree

220 files changed

+740
-1849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+740
-1849
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ class CompilationTests extends ParallelTesting {
110110
compileFile("tests/pos/erasure.scala", defaultOptions),
111111
compileFile("tests/pos/Coder.scala", defaultOptions),
112112
compileFile("tests/pos/blockescapes.scala", defaultOptions),
113-
compileFile("tests/pos/collections.scala", defaultOptions),
114113
compileFile("tests/pos/functions1.scala", defaultOptions),
115114
compileFile("tests/pos/implicits1.scala", defaultOptions),
116115
compileFile("tests/pos/inferred.scala", defaultOptions),
File renamed without changes.
File renamed without changes.

tests/neg/i1672.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
class Test {
33
implicit def compareComparables[T](x: T)(implicit ord: Ordering[T]) = // error: result type of implicit definition needs to be given explicitly
4-
new ord.Ops(x)
4+
new ord.OrderingOps(x)
55
class Bippy { def compare(y: Bippy) = util Random }
66
() < () // error: value `<` is not a member of Unit
77
}

tests/neg/i2960.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Tag(val name: String,
1111
val children: mutable.Buffer[Node] = mutable.Buffer()) extends Node {
1212

1313
override def mkString(n: Int): String = {
14-
Tag.spaces(n) + s"<$name ${attributes.map(_.name + "=" + Tag.unescape(_)).mkString(" ")}>" +
14+
Tag.spaces(n) + s"<$name ${attributes.map { case (k,v) => k.name + "=" + Tag.unescape(v) }.mkString(" ")}>" +
1515
(if(children.isEmpty) "\n"
1616
else children.map(_.mkString(n + 4)).mkString("\n", "\n", "\n")) +
1717
Tag.spaces(n) + s"</$name>"

tests/neg/i3067.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
class Test[T](f: List[String] => T)
1+
class Foo[A] {
2+
def map[B](f: A => B)(implicit bf: Int): B = ???
3+
}
4+
5+
class Test[T](f: Foo[String] => T)
26

37
object o {
48

59
implicit val x = 3 // error
610

711
implicit def y = "abc" // error
812

9-
implicit object a extends Test(_ map identity) // error
13+
implicit object a extends Test(_ map identity) // error // error: no implicit argument found
1014
implicit object b extends Test(_ map identity) // error // error: cyclic reference
1115
}

tests/neg/i3067b.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import collection.generic.CanBuildFrom
2-
31
class Test[T](f: List[String] => T)
42

53
object o {
6-
7-
implicitly[CanBuildFrom[String, Char, String]]
8-
94
implicit object b extends Test(_ map identity) // error: type needs to be given // error: cyclic reference
10-
115
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package x0.x0 {}
1+
package x0.x0 {} // error
22
object x0 {
33
def x0 (implicit // error
4-
// error
4+
// error

tests/neg/subtyping.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
| Cannot prove that B#X <:< A#X..
55
| I found:
66
|
7-
| $conforms[Nothing]
7+
| <:<.refl[Nothing]
88
|
9-
| But method $conforms in object Predef does not match type B#X <:< A#X.
9+
| But method refl in object <:< does not match type B#X <:< A#X.
1010
-- Error: tests/neg/subtyping.scala:12:27 ------------------------------------------------------------------------------
1111
12 | implicitly[a.T <:< a.U] // error: no implicit argument
1212
| ^
1313
| Cannot prove that a.T <:< a.U..
1414
| I found:
1515
|
16-
| $conforms[Nothing]
16+
| <:<.refl[Nothing]
1717
|
18-
| But method $conforms in object Predef does not match type a.T <:< a.U.
18+
| But method refl in object <:< does not match type a.T <:< a.U.

tests/pending/run/streams.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Test extends App {
88
println
99

1010
val s1 = Stream.cons(1, Stream.empty)
11-
println(s1.toArray.deep)
11+
println(s1.toArray.toList)
1212
println(s1.take(1))
1313
println(s1.take(2))
1414
println(s1.drop(1))
@@ -22,7 +22,7 @@ object Test extends App {
2222
println
2323

2424
val s2 = s1.append(Stream.cons(2, Stream.empty))
25-
println(s2.toArray.deep)
25+
println(s2.toArray.toList)
2626
println(s2.drop(1))
2727
println(s2.drop(2))
2828
println(s2.drop(-1))

0 commit comments

Comments
 (0)