From ee7f829d4cf08e9fdf8bba4207cbbdb670470d04 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 21 Nov 2024 22:07:53 -0600 Subject: [PATCH] conflicts: demo failed parse of markers with CRLF --- lib/tests/test_conflicts.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/tests/test_conflicts.rs b/lib/tests/test_conflicts.rs index 11bbf5ab7..8534f817e 100644 --- a/lib/tests/test_conflicts.rs +++ b/lib/tests/test_conflicts.rs @@ -725,6 +725,29 @@ fn test_parse_conflict_multi_way() { ); } +#[test] +fn test_parse_conflict_crlf_markers() { + // Conflict markers aren't recognized due to CRLF + assert_eq!( + parse_conflict( + indoc! {b" + line 1\r + <<<<<<<\r + +++++++\r + left\r + -------\r + base\r + +++++++\r + right\r + >>>>>>>\r + line 5\r + "}, + 2 + ), + None + ); +} + #[test] fn test_parse_conflict_wrong_arity() { // Valid conflict marker but it has fewer sides than the caller expected