fix test_ignore_path_set test when run on beta
```
---- ignore_path::test::test_ignore_path_set stdout ----
Warning: can't set `ignore = IgnoreList({"foo.rs", "bar_dir/*"})`, unstable features are only available in nightly channel.
thread 'ignore_path::test::test_ignore_path_set' panicked at 'assertion failed: ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs")))', src/ignore_path.rs:51:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
ignore_path::test::test_ignore_path_set
```
This commit is contained in:
parent
31fbf34439
commit
1c7202b2ee
1 changed files with 11 additions and 11 deletions
|
|
@ -39,17 +39,17 @@ mod test {
|
|||
|
||||
#[test]
|
||||
fn test_ignore_path_set() {
|
||||
let config = Config::from_toml(
|
||||
"ignore = [
|
||||
\"foo.rs\",
|
||||
\"bar_dir/*\",
|
||||
]",
|
||||
)
|
||||
.unwrap();
|
||||
let ignore_path_set = IgnorePathSet::from_ignore_list(&config.ignore()).unwrap();
|
||||
match option_env!("CFG_RELEASE_CHANNEL") {
|
||||
// this test requires nightly
|
||||
None | Some("nightly") => {
|
||||
let config = Config::from_toml(r#"ignore = ["foo.rs", "bar_dir/*"]"#).unwrap();
|
||||
let ignore_path_set = IgnorePathSet::from_ignore_list(&config.ignore()).unwrap();
|
||||
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs"))));
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("bar_dir/baz.rs"))));
|
||||
assert!(!ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/bar.rs"))));
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/foo.rs"))));
|
||||
assert!(ignore_path_set.is_match(&FileName::Real(PathBuf::from("bar_dir/baz.rs"))));
|
||||
assert!(!ignore_path_set.is_match(&FileName::Real(PathBuf::from("src/bar.rs"))));
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue