conflicts: demo failed parse of diff with empty line

This commit is contained in:
Scott Taylor 2024-11-21 22:20:51 -06:00 committed by Scott Taylor
parent 9674852dc7
commit efacbcbd45

View file

@ -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