Commit 2975f2a 1 parent 9a74dfa commit 2975f2a Copy full SHA for 2975f2a
File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,22 @@ fn read_test_cases(
86
86
let test_case_dirs =
87
87
fs:: read_dir ( test_data_dir) . unwrap ( ) . flatten ( ) . filter ( |c| c. path ( ) . is_dir ( ) ) ;
88
88
89
- test_case_dirs. into_iter ( ) . map ( |dir| {
89
+ test_case_dirs. into_iter ( ) . filter_map ( |dir| {
90
+ // When switching git branches we might end up with non-empty directories that have a `target`
91
+ // directory inside them but no `Nargo.toml`.
92
+ // These "tests" would always fail, but it's okay to ignore them so we do that here.
93
+ if !dir. path ( ) . join ( "Nargo.toml" ) . exists ( ) {
94
+ return None ;
95
+ }
96
+
90
97
let test_name =
91
98
dir. file_name ( ) . into_string ( ) . expect ( "Directory can't be converted to string" ) ;
92
99
if test_name. contains ( '-' ) {
93
100
panic ! (
94
101
"Invalid test directory: {test_name}. Cannot include `-`, please convert to `_`"
95
102
) ;
96
103
}
97
- ( test_name, dir. path ( ) )
104
+ Some ( ( test_name, dir. path ( ) ) )
98
105
} )
99
106
}
100
107
You can’t perform that action at this time.
0 commit comments