Skip to content

Commit b9ba16e

Browse files
smarterbishabosha
authored andcommitted
Adapt/remove tests for the 2.13 stdlib.
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. Unfortunately, I also had to remove a bunch of Dotty tests that relied on details of the 2.12 stdlib that I couldn't easily port to the 2.13 stdlib. i3518 has to be disabled because using scala.Unit is marked @compileTimeOnly and dotty crashes on @compileTimeOnly right now.
1 parent af63f66 commit b9ba16e

File tree

303 files changed

+945
-4120
lines changed

Some content is hidden

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

303 files changed

+945
-4120
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.
File renamed without changes.

tests/neg/equality.scala

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,5 @@ object equality {
119119
s1 == Nil // error
120120
Nil == s2 // error
121121
s2 == Nil // error
122-
123-
import collection.parallel._
124-
val p1 = ParSeq(1, 2, 3)
125-
val p2 = ParSeq()
126-
Nil == p1 // OK
127-
p1 == Nil // OK
128-
Nil == p2 // OK
129-
p2 == Nil // Ok
130-
131122
}
132123
}

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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import collection.generic.CanBuildFrom
1+
class Foo[A] {
2+
def map[B](f: A => B)(implicit bf: Int): B = ???
3+
}
24

3-
class Test[T](f: List[String] => T)
5+
class Test[T](f: Foo[String] => T)
46

57
object o {
6-
7-
implicitly[CanBuildFrom[String, Char, String]]
8-
98
implicit object b extends Test(_ map identity) // error: type needs to be given // error: cyclic reference
10-
119
}

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.

0 commit comments

Comments
 (0)