This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -37,21 +37,17 @@ mod test {
3737 use crate :: config:: { Config , FileName } ;
3838 use crate :: ignore_path:: IgnorePathSet ;
3939
40+ use rustfmt_config_proc_macro:: nightly_only_test;
41+
42+ #[ nightly_only_test]
4043 #[ test]
4144 fn test_ignore_path_set ( ) {
42- match option_env ! ( "CFG_RELEASE_CHANNEL" ) {
43- // this test requires nightly
44- None | Some ( "nightly" ) => {
45- let config =
46- Config :: from_toml ( r#"ignore = ["foo.rs", "bar_dir/*"]"# , Path :: new ( "" ) )
47- . unwrap ( ) ;
48- let ignore_path_set = IgnorePathSet :: from_ignore_list ( & config. ignore ( ) ) . unwrap ( ) ;
49-
50- assert ! ( ignore_path_set. is_match( & FileName :: Real ( PathBuf :: from( "src/foo.rs" ) ) ) ) ;
51- assert ! ( ignore_path_set. is_match( & FileName :: Real ( PathBuf :: from( "bar_dir/baz.rs" ) ) ) ) ;
52- assert ! ( !ignore_path_set. is_match( & FileName :: Real ( PathBuf :: from( "src/bar.rs" ) ) ) ) ;
53- }
54- _ => ( ) ,
55- } ;
45+ let config =
46+ Config :: from_toml ( r#"ignore = ["foo.rs", "bar_dir/*"]"# , Path :: new ( "" ) ) . unwrap ( ) ;
47+ let ignore_path_set = IgnorePathSet :: from_ignore_list ( & config. ignore ( ) ) . unwrap ( ) ;
48+
49+ assert ! ( ignore_path_set. is_match( & FileName :: Real ( PathBuf :: from( "src/foo.rs" ) ) ) ) ;
50+ assert ! ( ignore_path_set. is_match( & FileName :: Real ( PathBuf :: from( "bar_dir/baz.rs" ) ) ) ) ;
51+ assert ! ( !ignore_path_set. is_match( & FileName :: Real ( PathBuf :: from( "src/bar.rs" ) ) ) ) ;
5652 }
5753}
You can’t perform that action at this time.
0 commit comments