This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,6 @@ mod tests {
318
318
#[ test]
319
319
fn path_contains_rclone_modification_date_works ( ) {
320
320
let path = PathBuf :: from_str ( "/20221003093709 /Home/School" ) . unwrap ( ) ;
321
-
322
321
let option = path_contains_rclone_modification_date ( & path) ;
323
322
324
323
match option {
@@ -332,4 +331,25 @@ mod tests {
332
331
None => panic ! ( "Expected some value here." ) ,
333
332
}
334
333
}
334
+
335
+ #[ test]
336
+ fn path_contains_rclone_modification_date_fails_without_whitespace ( ) {
337
+ let path = PathBuf :: from_str ( "/20221003093709/Home/School" ) . unwrap ( ) ;
338
+ let option = path_contains_rclone_modification_date ( & path) ;
339
+ assert ! ( option. is_none( ) )
340
+ }
341
+
342
+ #[ test]
343
+ fn path_contains_rclone_modification_date_fails_with_wrong_timestamp_format ( ) {
344
+ let path = PathBuf :: from_str ( "/202210030937 /Home/School" ) . unwrap ( ) ;
345
+ let option = path_contains_rclone_modification_date ( & path) ;
346
+ assert ! ( option. is_none( ) )
347
+ }
348
+
349
+ #[ test]
350
+ fn path_contains_rclone_modification_date_fails_with_wrong_timestamp ( ) {
351
+ let path = PathBuf :: from_str ( "/20221003093790 /Home/School" ) . unwrap ( ) ;
352
+ let option = path_contains_rclone_modification_date ( & path) ;
353
+ assert ! ( option. is_none( ) )
354
+ }
335
355
}
You can’t perform that action at this time.
0 commit comments