File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ pub fn optimize_public_source_entry(source: &mut PublicSourceEntry) {
8686 None => base,
8787 } ;
8888
89+ // TODO: If the base does not exist on disk, try removing the last slash and try again.
8990 let base = match dunce:: canonicalize ( & base) {
9091 Ok ( base) => base,
9192 Err ( err) => {
Original file line number Diff line number Diff line change @@ -836,6 +836,33 @@ mod scanner {
836836 assert_eq ! ( candidates, vec![ "content-['keep-me.html']" ] ) ;
837837 }
838838
839+ #[ test]
840+ fn test_works_with_filenames_containing_glob_characters ( ) {
841+ // Create a temporary working directory
842+ let dir = tempdir ( ) . unwrap ( ) . into_path ( ) ;
843+
844+ // Create files
845+ create_files_in (
846+ & dir,
847+ & [
848+ ( "src/app/[foo]/ignore-me.html" , "content-['ignore-me.html']" ) ,
849+ ( "src/app/[foo]/keep-me.html" , "content-['keep-me.html']" ) ,
850+ ] ,
851+ ) ;
852+
853+ let sources = vec ! [
854+ PublicSourceEntry :: from_pattern( dir. clone( ) , "@source '**/*'" ) ,
855+ PublicSourceEntry :: from_pattern(
856+ dir. clone( ) ,
857+ "@source not 'src/app/[foo]/ignore*.html'" ,
858+ ) ,
859+ ] ;
860+
861+ let candidates = Scanner :: new ( sources. clone ( ) ) . scan ( ) ;
862+
863+ assert_eq ! ( candidates, vec![ "content-['keep-me.html']" ] ) ;
864+ }
865+
839866 #[ test]
840867 fn test_foo_bar ( ) {
841868 // Create a temporary working directory
You can’t perform that action at this time.
0 commit comments