Skip to content

Commit 5160d34

Browse files
neg playground added
1 parent 4e98ec6 commit 5160d34

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class CompilationTests extends ParallelTesting {
4242
compileFilesInDir("tests/playground/pos", defaultOptions).checkCompile()
4343
}
4444

45+
@Test def exampleNeg: Unit = {
46+
implicit val testGroup: TestGroup = TestGroup("examplePos")
47+
compileFilesInDir("tests/playground/neg", defaultOptions).checkExpectedErrors()
48+
}
49+
4550
@Test def exampleRun: Unit = {
4651
implicit val testGroup: TestGroup = TestGroup("exampleRun")
4752
compileFilesInDir("tests/playground/run", defaultOptions).checkRuns()

tests/playground/neg/example.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
stuff // error

tests/playground/neg/sample/A_1.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object A {
2+
val name = "World"afwsf
3+
}// error

tests/playground/neg/sample/B_2.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object B extends App {
2+
println(s"Hello, ${A.name}") // error
3+
}

tests/playground/pos/example.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
stuff

0 commit comments

Comments
 (0)