File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,12 @@ pub fn ensure_no_specific_syntax_errors(parsed_source: &ParsedSource) -> Result<
124124 SyntaxError :: ExpectedDigit { .. } |
125125 SyntaxError :: ExpectedSemiForExprStmt { .. } |
126126 SyntaxError :: ExpectedUnicodeEscape |
127+ // various unterminated
128+ SyntaxError :: UnterminatedStrLit |
129+ SyntaxError :: UnterminatedBlockComment |
130+ SyntaxError :: UnterminatedJSXContents |
131+ SyntaxError :: UnterminatedRegExp |
132+ SyntaxError :: UnterminatedTpl |
127133 // unexpected token
128134 SyntaxError :: Unexpected { .. } |
129135 // Merge conflict marker
@@ -293,6 +299,19 @@ mod tests {
293299 ) ;
294300 }
295301
302+ #[ test]
303+ fn it_should_error_for_exected_string_literal ( ) {
304+ run_non_fatal_diagnostic_test (
305+ "./test.ts" ,
306+ "var foo = 'test" ,
307+ concat ! (
308+ "Unterminated string constant at file:///test.ts:1:11\n \n " ,
309+ " var foo = 'test\n " ,
310+ " ~~~~~"
311+ ) ,
312+ ) ;
313+ }
314+
296315 #[ test]
297316 fn it_should_error_for_merge_conflict_marker ( ) {
298317 run_non_fatal_diagnostic_test (
You can’t perform that action at this time.
0 commit comments