File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
lrpar/cttests/src/ctfails Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -561,9 +561,16 @@ where
561561 match setting {
562562 Setting :: String ( test_files, _) => {
563563 let path_joined = grm_path. parent ( ) . unwrap ( ) . join ( test_files) ;
564- for path in
565- glob ( & path_joined. to_string_lossy ( ) ) . map_err ( |e| e. to_string ( ) ) ?
566- {
564+ let path_str = & path_joined. to_string_lossy ( ) ;
565+ let mut glob_paths = glob ( path_str) . map_err ( |e| e. to_string ( ) ) ?. peekable ( ) ;
566+ if glob_paths. peek ( ) . is_none ( ) {
567+ return Err ( format ! ( "'test_files' glob '{}' matched no paths" , path_str)
568+ . to_string ( )
569+ . into ( ) ,
570+ ) ;
571+ }
572+
573+ for path in glob_paths {
567574 let path = path?;
568575 if let Some ( ext) = path. extension ( ) {
569576 if let Some ( ext) = ext. to_str ( ) {
Original file line number Diff line number Diff line change 1+ name: Test empty matchless glob in array of %grmtools{test_files}
2+ grammar: |
3+ %grmtools {
4+ yacckind: Original(YaccOriginalActionKind::UserAction),
5+ recoverer: RecoveryKind::None,
6+ test_files: ["*.nonexistent"]
7+ }
8+ %start Expr
9+ %actiontype ()
10+ %%
11+ Expr: '(' ')' { () } ;
12+ lexer: |
13+ %%
14+ \( "("
15+ \) ")"
16+ [\t\n ]+ ;
You can’t perform that action at this time.
0 commit comments