globset: compact Debug impl for GlobSetBuilder and Glob
Ideally we'd have a compact impl for `GlobSet` too, but that's a lot more work. In particular, the constituent types don't all store the original pattern string, so that would need to be added. Closes #3026
This commit is contained in:
committed by
Andrew Gallant
parent
e83828fc8c
commit
6f39f830cb
@@ -1100,4 +1100,16 @@ mod tests {
|
||||
let matches = set.matches("nada");
|
||||
assert_eq!(0, matches.len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn debug() {
|
||||
let mut builder = GlobSetBuilder::new();
|
||||
builder.add(Glob::new("*foo*").unwrap());
|
||||
builder.add(Glob::new("*bar*").unwrap());
|
||||
builder.add(Glob::new("*quux*").unwrap());
|
||||
assert_eq!(
|
||||
format!("{builder:?}"),
|
||||
"GlobSetBuilder { pats: [Glob(\"*foo*\"), Glob(\"*bar*\"), Glob(\"*quux*\")] }",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user