File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
tests/foreach_html5lib_test Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,19 @@ pub fn foreach_html5lib_test<Mk>(
23
23
test_dir_path. push ( "html5lib-tests" ) ;
24
24
test_dir_path. push ( subdir) ;
25
25
26
- let test_files = fs:: read_dir ( & test_dir_path) . unwrap ( ) ;
27
- for entry in test_files {
28
- let path = entry. unwrap ( ) . path ( ) ;
29
- if path. extension ( ) == Some ( ext) {
30
- let file = fs:: File :: open ( & path) . unwrap ( ) ;
31
- mk ( & path, file) ;
26
+ let maybe_test_files = fs:: read_dir ( & test_dir_path) ;
27
+ match maybe_test_files {
28
+ Ok ( test_files) => {
29
+ for entry in test_files {
30
+ let path = entry. unwrap ( ) . path ( ) ;
31
+ if path. extension ( ) == Some ( ext) {
32
+ let file = fs:: File :: open ( & path) . unwrap ( ) ;
33
+ mk ( & path, file) ;
34
+ }
35
+ }
36
+ } ,
37
+ Err ( _) => {
38
+ panic ! ( "Before launching the tests, please run this command:\n \n \t git submodule update --init\n \n to retrieve an html5lib-tests snapshot." ) ;
32
39
}
33
40
}
34
41
}
You can’t perform that action at this time.
0 commit comments