File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ function check_fmt_with_lib_tests {
4242
4343function check_fmt_base {
4444 local test_args=" $1 "
45- cargo test $test_args
46- if [[ $? != 0 ]]; then
45+ local build= $( cargo test $test_args 2>&1 )
46+ if [[ " $build " =~ " build failed " ]] || [[ " $build " =~ " test result: FAILED. " ]]; then
4747 return 0
4848 fi
4949 touch rustfmt.toml
Original file line number Diff line number Diff line change @@ -39,17 +39,17 @@ mod test {
3939
4040 #[ test]
4141 fn test_ignore_path_set ( ) {
42- let config = Config :: from_toml (
43- "ignore = [
44- \" foo.rs \" ,
45- \" bar_dir/*\" ,
46- ]" ,
47- )
48- . unwrap ( ) ;
49- let ignore_path_set = IgnorePathSet :: from_ignore_list ( & config . ignore ( ) ) . unwrap ( ) ;
50-
51- assert ! ( ignore_path_set . is_match ( & FileName :: Real ( PathBuf :: from ( "src/foo.rs" ) ) ) ) ;
52- assert ! ( ignore_path_set . is_match ( & FileName :: Real ( PathBuf :: from ( "bar_dir/baz.rs" ) ) ) ) ;
53- assert ! ( !ignore_path_set . is_match ( & FileName :: Real ( PathBuf :: from ( "src/bar.rs" ) ) ) ) ;
42+ match option_env ! ( "CFG_RELEASE_CHANNEL" ) {
43+ // this test requires nightly
44+ None | Some ( "nightly" ) => {
45+ let config = Config :: from_toml ( r#"ignore = ["foo.rs", " bar_dir/*"]"# ) . unwrap ( ) ;
46+ let ignore_path_set = IgnorePathSet :: from_ignore_list ( & config . ignore ( ) ) . unwrap ( ) ;
47+
48+ assert ! ( ignore_path_set . is_match ( & FileName :: Real ( PathBuf :: from ( "src/foo.rs" ) ) ) ) ;
49+ assert ! ( ignore_path_set . is_match ( & FileName :: Real ( PathBuf :: from ( "bar_dir/baz.rs" ) ) ) ) ;
50+ assert ! ( !ignore_path_set . is_match ( & FileName :: Real ( PathBuf :: from ( "src/bar.rs" ) ) ) ) ;
51+ }
52+ _ => ( ) ,
53+ } ;
5454 }
5555}
You can’t perform that action at this time.
0 commit comments