WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ pub fn make_file_finder_include_ignored_an_enum(value: &mut Value) -> Result<()>
1717 Value :: Bool ( true ) => Value :: String ( "all" . to_string ( ) ) ,
1818 Value :: Bool ( false ) => Value :: String ( "indexed" . to_string ( ) ) ,
1919 Value :: Null => Value :: String ( "smart" . to_string ( ) ) ,
20+ Value :: String ( s) if s == "all" || s == "indexed" || s == "smart" => return Ok ( ( ) ) ,
2021 _ => anyhow:: bail!( "Expected include_ignored to be a boolean or null" ) ,
2122 } ;
2223 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -366,7 +366,13 @@ mod tests {
366366 #[ track_caller]
367367 fn assert_migrate_settings ( input : & str , output : Option < & str > ) {
368368 let migrated = migrate_settings ( input) . unwrap ( ) ;
369- assert_migrated_correctly ( migrated, output) ;
369+ assert_migrated_correctly ( migrated. clone ( ) , output) ;
370+
371+ // expect that rerunning the migration does not result in another migration
372+ if let Some ( migrated) = migrated {
373+ let rerun = migrate_settings ( & migrated) . unwrap ( ) ;
374+ assert_migrated_correctly ( rerun, None ) ;
375+ }
370376 }
371377
372378 #[ track_caller]
@@ -376,7 +382,13 @@ mod tests {
376382 output : Option < & str > ,
377383 ) {
378384 let migrated = run_migrations ( input, migrations) . unwrap ( ) ;
379- assert_migrated_correctly ( migrated, output) ;
385+ assert_migrated_correctly ( migrated. clone ( ) , output) ;
386+
387+ // expect that rerunning the migration does not result in another migration
388+ if let Some ( migrated) = migrated {
389+ let rerun = run_migrations ( & migrated, migrations) . unwrap ( ) ;
390+ assert_migrated_correctly ( rerun, None ) ;
391+ }
380392 }
381393
382394 #[ test]
You can’t perform that action at this time.
0 commit comments