mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 00:56:23 +00:00
fileset: filter out glob tokens field from snapshot tests
It will become more verbose in the next patch.
This commit is contained in:
parent
f1bcd42883
commit
2888c1d842
1 changed files with 9 additions and 13 deletions
|
@ -505,6 +505,8 @@ mod tests {
|
|||
|
||||
fn insta_settings() -> insta::Settings {
|
||||
let mut settings = insta::Settings::clone_current();
|
||||
// Elide parsed glob tokens, which aren't interesting.
|
||||
settings.add_filter(r"\b(tokens): \[[^]]*\],", "$1: _,");
|
||||
// Collapse short "Thing(_,)" repeatedly to save vertical space and make
|
||||
// the output more readable.
|
||||
for _ in 0..4 {
|
||||
|
@ -791,47 +793,41 @@ mod tests {
|
|||
})
|
||||
};
|
||||
|
||||
insta::assert_debug_snapshot!(glob_expr("", "*").to_matcher(), @r###"
|
||||
insta::assert_debug_snapshot!(glob_expr("", "*").to_matcher(), @r#"
|
||||
FileGlobsMatcher {
|
||||
tree: [
|
||||
Pattern {
|
||||
original: "*",
|
||||
tokens: [
|
||||
AnySequence,
|
||||
],
|
||||
tokens: _,
|
||||
is_recursive: false,
|
||||
},
|
||||
] {},
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
|
||||
let expr =
|
||||
FilesetExpression::union_all(vec![glob_expr("foo", "*"), glob_expr("foo/bar", "*")]);
|
||||
insta::assert_debug_snapshot!(expr.to_matcher(), @r###"
|
||||
insta::assert_debug_snapshot!(expr.to_matcher(), @r#"
|
||||
FileGlobsMatcher {
|
||||
tree: [] {
|
||||
"foo": [
|
||||
Pattern {
|
||||
original: "*",
|
||||
tokens: [
|
||||
AnySequence,
|
||||
],
|
||||
tokens: _,
|
||||
is_recursive: false,
|
||||
},
|
||||
] {
|
||||
"bar": [
|
||||
Pattern {
|
||||
original: "*",
|
||||
tokens: [
|
||||
AnySequence,
|
||||
],
|
||||
tokens: _,
|
||||
is_recursive: false,
|
||||
},
|
||||
] {},
|
||||
},
|
||||
},
|
||||
}
|
||||
"###);
|
||||
"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue