Skip to content

Commit

Permalink
conflicts: demo failed parse of diff with empty line
Browse files Browse the repository at this point in the history
  • Loading branch information
scott2000 committed Nov 22, 2024
1 parent f166399 commit 8f71310
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/tests/test_conflicts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,32 @@ fn test_parse_conflict_crlf_markers() {
);
}

#[test]
fn test_parse_conflict_diff_stripped_whitespace() {
// Conflict parsing fails since diff contains empty line without leading space
assert_eq!(
parse_conflict(
indoc! {b"
line 1
<<<<<<<
%%%%%%%
line 2
-line 3
+left
\r
line 4
+++++++
right
>>>>>>>
line 5
"},
2
),
None
);
}

#[test]
fn test_parse_conflict_wrong_arity() {
// Valid conflict marker but it has fewer sides than the caller expected
Expand Down

0 comments on commit 8f71310

Please sign in to comment.