From a0521e075429f2f7755363e95071cce77e2e361c Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 2 Jan 2022 23:55:50 +0000 Subject: [PATCH] Failing grep parse test cases --- src/handlers/grep.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/handlers/grep.rs b/src/handlers/grep.rs index 65db9ea54..02184f879 100644 --- a/src/handlers/grep.rs +++ b/src/handlers/grep.rs @@ -691,6 +691,28 @@ mod tests { submatches: None, }) ); + + assert_eq!( + parse_grep_line(r#"aaa/bbb.scala- s"xxx.yyy.zzz: $ccc ddd""#), + Some(GrepLine { + path: "aaa/bbb.scala".into(), + line_number: None, + line_type: LineType::Context, + code: r#" s"xxx.yyy.zzz: $ccc ddd""#.into(), + submatches: None, + }) + ); + + assert_eq!( + parse_grep_line(r#"aaa/bbb.scala- val atRegex = Regex.compile("(@.*)|(-shdw@.*)""#), + Some(GrepLine { + path: "aaa/bbb.scala".into(), + line_number: None, + line_type: LineType::Context, + code: r#" val atRegex = Regex.compile("(@.*)|(-shdw@.*)""#.into(), + submatches: None, + }) + ); } #[test]