Skip to content

Commit 53e0c73

Browse files
committed
add more tests
1 parent 7695198 commit 53e0c73

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

compiler-core/src/parse/tests.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,23 @@ fn merge_conflict_lt() {
405405
);
406406
}
407407

408+
#[test]
409+
fn merge_conflict_lt_with_head() {
410+
assert_error!(
411+
"let wobble: Int = 32
412+
<<<<<<< HEAD",
413+
ParseError {
414+
error: ParseErrorType::LexError {
415+
error: LexicalError {
416+
error: LexicalErrorType::MergeConflictIndicator,
417+
location: SrcSpan { start: 29, end: 36 },
418+
}
419+
},
420+
location: SrcSpan { start: 29, end: 36 },
421+
}
422+
);
423+
}
424+
408425
#[test]
409426
fn four_lt_not_merge_conflict() {
410427
assert_error!(
@@ -462,6 +479,23 @@ fn merge_conflict_gt() {
462479
);
463480
}
464481

482+
#[test]
483+
fn merge_conflict_gt_with_branch_name() {
484+
assert_error!(
485+
"let wobble: Int = 32
486+
>>>>>>> main",
487+
ParseError {
488+
error: ParseErrorType::LexError {
489+
error: LexicalError {
490+
error: LexicalErrorType::MergeConflictIndicator,
491+
location: SrcSpan { start: 29, end: 36 },
492+
}
493+
},
494+
location: SrcSpan { start: 29, end: 36 },
495+
}
496+
);
497+
}
498+
465499
#[test]
466500
fn four_gt_not_merge_conflict() {
467501
assert_error!(

0 commit comments

Comments
 (0)