File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -447,6 +447,39 @@ fn exclude_precedence_over_include() -> anyhow::Result<()> {
447447 Ok ( ( ) )
448448}
449449
450+ /// `src/keep.py` and `src/explicit` must be found under `dir[1]`. An unescaped
451+ /// `[1]` in their anchored globs would match paths under `dir1` instead,
452+ /// missing both files. `src/skip.py` must be excluded.
453+ #[ test]
454+ fn project_directory_brackets_do_not_act_as_glob_syntax ( ) -> anyhow:: Result < ( ) > {
455+ let case = CliTest :: with_files ( [
456+ (
457+ "dir[1]/ty.toml" ,
458+ r#"
459+ [src]
460+ include = ["src/*.py", "src/explicit"]
461+ exclude = ["src/skip.py"]
462+ "# ,
463+ ) ,
464+ ( "dir[1]/src/keep.py" , "print(undefined_keep)" ) ,
465+ ( "dir[1]/src/skip.py" , "print(undefined_skip)" ) ,
466+ ( "dir[1]/src/explicit" , "print(undefined_explicit)" ) ,
467+ ] ) ?;
468+
469+ assert_cmd_snapshot ! ( case. command( ) . current_dir( case. root( ) . join( "dir[1]" ) ) . env( "TY_OUTPUT_FORMAT" , "concise" ) , @r#"
470+ success: false
471+ exit_code: 1
472+ ----- stdout -----
473+ src/explicit:1:7: error[unresolved-reference] Name `undefined_explicit` used when not defined
474+ src/keep.py:1:7: error[unresolved-reference] Name `undefined_keep` used when not defined
475+ Found 2 diagnostics
476+
477+ ----- stderr -----
478+ "# ) ;
479+
480+ Ok ( ( ) )
481+ }
482+
450483/// Test that CLI exclude overrides configuration include
451484#[ test]
452485fn exclude_argument_precedence_include_argument ( ) -> anyhow:: Result < ( ) > {
Original file line number Diff line number Diff line change @@ -426,7 +426,6 @@ mod tests {
426426 }
427427
428428 #[ test]
429- #[ cfg( unix) ]
430429 fn match_file_with_metacharacters_in_cwd ( ) {
431430 let mut builder = IncludeFilterBuilder :: new ( ) ;
432431 builder
You can’t perform that action at this time.
0 commit comments