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.

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.

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))

tests/pending/run/t0421-old.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ object Test extends App {
1717
def matmul(xss: Array[Array[Double]], yss: Array[Array[Double]]) = {
1818
val ysst = transpose(yss)
1919
val ysst1: Array[Array[Double]] = yss.transpose
20-
assert(ysst.deep == ysst1.deep)
20+
assert(ysst.toList == ysst1.toList)
2121
for (xs <- xss) yield
2222
for (yst <- ysst) yield
2323
scalprod(xs, yst)
2424
}
2525

2626
val a1 = Array(Array(0, 2, 4), Array(1, 3, 5))
27-
println(transpose(a1).deep.mkString("[", ",", "]"))
27+
println(transpose(a1).toList.mkString("[", ",", "]"))
2828

29-
println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).deep.mkString("[", ",", "]"))
29+
println(matmul(Array(Array(2, 3)), Array(Array(5), Array(7))).toList.mkString("[", ",", "]"))
3030

31-
println(matmul(Array(Array(4)), Array(Array(6, 8))).deep.mkString("[", ",", "]"))
31+
println(matmul(Array(Array(4)), Array(Array(6, 8))).toList.mkString("[", ",", "]"))
3232
}

tests/pending/run/t3158.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object Test {
22
def main(args: Array[String]): Unit = {
3-
println(args.map(_ => foo _).deep)
3+
println(args.map(_ => foo _).toList)
44
}
55

66
def foo(xs: String*): Unit = {

tests/pending/run/t5966.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(o()_)("") = List()
2-
(o("a1")_)("") = WrappedArray(a1)
3-
(o("a1", "a2")_)("") = WrappedArray(a1, a2)
2+
(o("a1")_)("") = ArraySeq(a1)
3+
(o("a1", "a2")_)("") = ArraySeq(a1, a2)

tests/pos-deep-subtype/i6119.scala

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/pos-java-interop/t2956/BeanDefinitionVisitor.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/pos-java-interop/t2956/t2956.scala

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)