insta
insta copied to clipboard
Allow non-vec filters
Filters such as
insta::with_settings!({
filters => vec![
(r"\d+(ms|s)", "[TIME]"),
]
}, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.arg("compile")
.arg("input.txt")
});
currently require a Vec:
https://github.com/mitsuhiko/insta/blob/324cd7154a2f5e4b5198747049202f69305c2ac5/src/filters.rs#L12-L20
Could this requirement be lifted to allow slices or any iterable? I'd like to use e.g.
insta::with_settings!({
filters => INSTA_FILTERS
}, {
assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME))
.arg("compile")
.arg("input.txt")
});
There is a PR open for it, but I haven't had the courage yet to make the change. #400
Closed by 1d70238