File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ pub fn ensure_no_specific_syntax_errors(parsed_source: &ParsedSource) -> Result<
75
75
SyntaxError :: ExpectedSemiForExprStmt { .. } |
76
76
SyntaxError :: ExpectedUnicodeEscape |
77
77
// unexpected token
78
- SyntaxError :: Unexpected { .. }
78
+ SyntaxError :: Unexpected { .. } |
79
+ // Merge conflict marker
80
+ SyntaxError :: TS1185
79
81
)
80
82
} )
81
83
. collect :: < Vec < _ > > ( ) ;
@@ -225,6 +227,35 @@ mod tests {
225
227
) ;
226
228
}
227
229
230
+ #[ test]
231
+ fn it_should_error_for_merge_conflict_marker ( ) {
232
+ run_non_fatal_diagnostic_test (
233
+ "./test.ts" ,
234
+ r#"class Test {
235
+ <<<<<<< HEAD
236
+ v = 1;
237
+ =======
238
+ v = 2;
239
+ >>>>>>> Branch-a
240
+ }
241
+ "# ,
242
+ r#"Merge conflict marker encountered. at ./test.ts:2:1
243
+
244
+ <<<<<<< HEAD
245
+ ~~~~~~~
246
+
247
+ Merge conflict marker encountered. at ./test.ts:4:1
248
+
249
+ =======
250
+ ~~~~~~~
251
+
252
+ Merge conflict marker encountered. at ./test.ts:6:1
253
+
254
+ >>>>>>> Branch-a
255
+ ~~~~~~~"# ,
256
+ ) ;
257
+ }
258
+
228
259
fn run_non_fatal_diagnostic_test ( file_path : & str , text : & str , expected : & str ) {
229
260
let file_path = PathBuf :: from ( file_path) ;
230
261
assert_eq ! ( format!( "{}" , parse_swc_ast( & file_path, text) . err( ) . unwrap( ) ) , expected) ;
You can’t perform that action at this time.
0 commit comments