This repository was archived by the owner on May 28, 2025. It is now read-only.
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 {
42
42
43
43
function check_fmt_base {
44
44
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
47
47
return 0
48
48
fi
49
49
touch rustfmt.toml
Original file line number Diff line number Diff line change @@ -39,17 +39,17 @@ mod test {
39
39
40
40
#[ test]
41
41
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
+ } ;
54
54
}
55
55
}
You can’t perform that action at this time.
0 commit comments