Recently, I ran into a failure like this:1
fn main() {
let actual = r#" before_tokens: "["let", "(", "_", ",", "ref_count"]","#;
let expected = r#" before_tokens: "[..]","#;
snapbox::assert_data_eq!(actual, expected);
}
From what I can tell, the problem is:
expected gets broken up into sections before_tokens: " and ",.
- The latter appears in the middle of
actual just after let.
- When there are no more sections to process,
line_matches returns false because remainder is not empty:
|
return remainder.is_empty(); |
Does that sound about right?
If so, would you be open to a reimplementation of line_matches that uses regex Captures?
Recently, I ran into a failure like this:1
From what I can tell, the problem is:
expectedgets broken up into sectionsbefore_tokens: "and",.actualjust afterlet.line_matchesreturns false becauseremainderis not empty:snapbox/crates/snapbox/src/filter/pattern.rs
Line 599 in 90fd7f0
Does that sound about right?
If so, would you be open to a reimplementation of
line_matchesthat uses regexCaptures?Footnotes
Corrected per @Muscraft's comment: https://github.com/assert-rs/snapbox/issues/411#issuecomment-3539740339 ↩