File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ pub use self::clap::{
441441
442442#[ cfg( test) ]
443443mod value_parser_tests {
444- use super :: { AsRange , ParseRenameFraction } ;
444+ use super :: { AsRange , AsTime , ParseRenameFraction } ;
445445 use clap:: Parser ;
446446
447447 #[ test]
@@ -479,4 +479,16 @@ mod value_parser_tests {
479479 let c = Cmd :: parse_from ( [ "cmd" , "-l=1,10" ] ) ;
480480 assert_eq ! ( c. arg, Some ( 1 ..10 ) ) ;
481481 }
482+
483+ #[ test]
484+ fn since ( ) {
485+ #[ derive( Debug , clap:: Parser ) ]
486+ pub struct Cmd {
487+ #[ clap( long, long="since" , value_parser = AsTime ) ]
488+ pub arg : Option < gix:: date:: Time > ,
489+ }
490+
491+ let c = Cmd :: parse_from ( [ "cmd" , "--since='2 weeks ago'" ] ) ;
492+ assert ! ( matches!( c. arg, Some ( gix:: date:: Time { .. } ) ) ) ;
493+ }
482494}
You can’t perform that action at this time.
0 commit comments