Skip to content

Commit 27a700d

Browse files
committed
Modify the existing testAllInOne to avoid bugs in Scala 3.2.1 #SCL-20734
- The lines that instantiate classes from scala.concurrent.duration have been removed due to scala/scala3#16322. A test will be added for that specifically. - The presentation of some methods has been changed in the platform, to show a `:` instead of `=>`.
1 parent 422ef2d commit 27a700d

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

scala/worksheet/test/org/jetbrains/plugins/scala/worksheet/integration/repl/WorksheetReplIntegration_Scala_3_Test.scala

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,111 @@ import org.junit.Assert._
99

1010
import scala.language.postfixOps
1111

12+
@RunWithScalaVersions(Array(TestScalaVersion.Scala_3_Latest))
13+
class WorksheetReplIntegration_Scala_3_Latest_Test extends WorksheetReplIntegration_Scala_3_BaseTest {
14+
override def testAllInOne(): Unit = {
15+
val before =
16+
"""import java.io.PrintStream
17+
|import scala.collection.Seq;
18+
|
19+
|println(Seq(1, 2, 3))
20+
|println(1)
21+
|
22+
|()
23+
|23
24+
|"str"
25+
|
26+
|def foo = "123" + 1
27+
|def foo0 = 1
28+
|def foo1() = 1
29+
|def foo2: Int = 1
30+
|def foo3(): Int = 1
31+
|def foo4(p: String) = 1
32+
|def foo5(p: String): Int = 1
33+
|def foo6(p: String, q: Short): Int = 1
34+
|def foo7[T] = 1
35+
|def foo8[T]() = 1
36+
|def foo9[T]: Int = 1
37+
|def foo10[T](): Int = 1
38+
|def foo11[T](p: String) = 1
39+
|def foo12[T](p: String): Int = 1
40+
|def foo13[T](p: String, q: Short): Int = 1
41+
|
42+
|val _ = 1
43+
|val x = 2
44+
|val y = x.toString + foo
45+
|val x2: PrintStream = null
46+
|
47+
|def f = 11
48+
|var _ = 5
49+
|var v1 = 6
50+
|var v2 = v1 + f
51+
|v2 = v1
52+
|
53+
|class A
54+
|trait B
55+
|object B
56+
|
57+
|enum ListEnum[+A] {
58+
| case Cons(h: A, t: ListEnum[A])
59+
| case Empty
60+
|}
61+
|
62+
|println(ListEnum.Empty)
63+
|println(ListEnum.Cons(42, ListEnum.Empty))""".stripMargin
64+
val after =
65+
"""
66+
|
67+
|
68+
|List(1, 2, 3)
69+
|1
70+
|
71+
|
72+
|val res0: Int = 23
73+
|val res1: String = str
74+
|
75+
|def foo: String
76+
|def foo0: Int
77+
|def foo1(): Int
78+
|def foo2: Int
79+
|def foo3(): Int
80+
|def foo4(p: String): Int
81+
|def foo5(p: String): Int
82+
|def foo6(p: String, q: Short): Int
83+
|def foo7[T]: Int
84+
|def foo8[T](): Int
85+
|def foo9[T]: Int
86+
|def foo10[T](): Int
87+
|def foo11[T](p: String): Int
88+
|def foo12[T](p: String): Int
89+
|def foo13[T](p: String, q: Short): Int
90+
|
91+
|
92+
|val x: Int = 2
93+
|val y: String = 21231
94+
|val x2: java.io.PrintStream = null
95+
|
96+
|def f: Int
97+
|
98+
|var v1: Int = 6
99+
|var v2: Int = 17
100+
|v2: Int = 6
101+
|
102+
|// defined class A
103+
|// defined trait B
104+
|// defined object B
105+
|
106+
|// defined class ListEnum
107+
|
108+
|
109+
|
110+
|
111+
|Empty
112+
|Cons(42,Empty)""".stripMargin
113+
doRenderTest(before, after)
114+
}
115+
}
116+
12117
@RunWithScalaVersions(Array(
13118
TestScalaVersion.Scala_3_0,
14119
TestScalaVersion.Scala_3_1

0 commit comments

Comments
 (0)