Skip to content

Commit

Permalink
Failing grep parse test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jan 2, 2022
1 parent db3936d commit a0521e0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/handlers/grep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit a0521e0

Please sign in to comment.