@@ -42,18 +42,22 @@ class ShouldCompileSpec extends FunSpec {
42
42
assert(e.failedCodeLineNumber === (Some (thisLineNumber - 6 )))
43
43
}
44
44
45
- // SKIP-DOTTY-START
46
45
it(" should throw TestFailedException with correct message and stack depth when parse failed" ) {
46
+
47
+ // SKIP-DOTTY-START
48
+ val errMsg = Resources .expectedNoErrorButGotParseError(" " , " " )
49
+ // SKIP-DOTTY-END
50
+ // DOTTY-ONLY val errMsg = Resources.expectedNoErrorButGotTypeError("", "")
51
+
47
52
val e = intercept[TestFailedException ] {
48
53
" println(\" test)" should compile
49
54
}
50
- val errMsg = Resources .expectedNoErrorButGotParseError( " " , " " )
55
+
51
56
assert(e.message.get.startsWith(errMsg.substring(0 , errMsg.indexOf(':' ))))
52
57
assert(e.message.get.indexOf(" println(\" test)" ) >= 0 )
53
58
assert(e.failedCodeFileName === (Some (fileName)))
54
59
assert(e.failedCodeLineNumber === (Some (thisLineNumber - 6 )))
55
60
}
56
- // SKIP-DOTTY-END
57
61
58
62
}
59
63
@@ -74,19 +78,23 @@ class ShouldCompileSpec extends FunSpec {
74
78
assert(e.failedCodeLineNumber === (Some (thisLineNumber - 6 )))
75
79
}
76
80
77
- // SKIP-DOTTY-START
78
81
it(" should throw TestFailedException with correct message and stack depth when parse failed" ) {
82
+
83
+ // SKIP-DOTTY-START
84
+ val errMsg = Resources .expectedNoErrorButGotParseError(" " , " " )
85
+ // SKIP-DOTTY-END
86
+ // DOTTY-ONLY val errMsg = Resources.expectedNoErrorButGotTypeError("", "")
87
+
79
88
val e = intercept[TestFailedException ] {
80
89
""" println("test)""" should compile
81
90
}
82
- val errMsg = Resources .expectedNoErrorButGotParseError( " " , " " )
91
+
83
92
assert(e.message.get.startsWith(errMsg.substring(0 , errMsg.indexOf(':' ))))
84
93
assert(e.message.get.indexOf(" println(\" test)" ) >= 0 )
85
94
assert(e.failedCodeFileName === (Some (fileName)))
86
95
assert(e.failedCodeLineNumber === (Some (thisLineNumber - 6 )))
87
96
}
88
- // SKIP-DOTTY-END
89
-
97
+
90
98
}
91
99
92
100
// SKIP-DOTTY-START
0 commit comments