@@ -2722,9 +2722,14 @@ fn cookiecutter_globbing() -> Result<()> {
2722
2722
// F811 example from the docs to ensure the glob still works
2723
2723
let maintest = tests. join ( "maintest.py" ) ;
2724
2724
fs:: write ( maintest, "import foo\n import bar\n import foo" ) ?;
2725
- insta:: with_settings!( {
2726
- filters => vec![ ( tempdir_filter( & tempdir) . as_str( ) , "[TMP]/" ) , ( r"\\" , "/" ) ]
2727
- } , {
2725
+
2726
+ let tmp_filter = tempdir_filter ( & tempdir) ;
2727
+ let filters = vec ! [
2728
+ ( tmp_filter. as_str( ) , "[TMP]/" ) ,
2729
+ ( r#"\\(\w\w|\s|\.|")"# , "/$1" ) ,
2730
+ ] ;
2731
+
2732
+ insta:: with_settings!( { filters => filters. clone( ) } , {
2728
2733
assert_cmd_snapshot!( Command :: new( get_cargo_bin( BIN_NAME ) )
2729
2734
. args( STDIN_BASE_OPTIONS )
2730
2735
. arg( "--select=F811" )
@@ -2742,9 +2747,7 @@ fn cookiecutter_globbing() -> Result<()> {
2742
2747
// after removing the config file with the ignore, F811 applies, so the glob worked above
2743
2748
fs:: remove_file ( cookiecutter_toml) ?;
2744
2749
2745
- insta:: with_settings!( {
2746
- filters => vec![ ( tempdir_filter( & tempdir) . as_str( ) , "[TMP]/" ) , ( r"\\" , "/" ) ]
2747
- } , {
2750
+ insta:: with_settings!( { filters => filters} , {
2748
2751
assert_cmd_snapshot!( Command :: new( get_cargo_bin( BIN_NAME ) )
2749
2752
. args( STDIN_BASE_OPTIONS )
2750
2753
. arg( "--select=F811" )
0 commit comments