File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,8 @@ fn test_valid_hex_duration(#[case] input: &str) {
305305#[ case:: wrong_capitalization( "infD" ) ]
306306#[ case:: wrong_capitalization( "INFD" ) ]
307307#[ case:: wrong_capitalization( "iNfD" ) ]
308- fn test_invalid_hex_duration ( #[ case] input : & str ) {
308+ #[ case:: single_quote( "'1" ) ]
309+ fn test_invalid_duration ( #[ case] input : & str ) {
309310 new_ucmd ! ( )
310311 . args ( & [ "--" , input] )
311312 . fails ( )
Original file line number Diff line number Diff line change 33// For the full copyright and license information, please view the LICENSE
44// file that was distributed with this source code.
55// spell-checker:ignore dont
6+ use rstest:: rstest;
7+
8+ use uucore:: display:: Quotable ;
69use uutests:: new_ucmd;
710use uutests:: util:: TestScenario ;
811use uutests:: util_name;
@@ -22,12 +25,14 @@ fn test_subcommand_return_code() {
2225 new_ucmd ! ( ) . arg ( "1" ) . arg ( "false" ) . fails_with_code ( 1 ) ;
2326}
2427
25- #[ test]
26- fn test_invalid_time_interval ( ) {
28+ #[ rstest]
29+ #[ case:: alphabetic( "xyz" ) ]
30+ #[ case:: single_quote( "'1" ) ]
31+ fn test_invalid_time_interval ( #[ case] input : & str ) {
2732 new_ucmd ! ( )
28- . args ( & [ "xyz" , "sleep" , "0" ] )
33+ . args ( & [ input , "sleep" , "0" ] )
2934 . fails_with_code ( 125 )
30- . usage_error ( "invalid time interval 'xyz'" ) ;
35+ . usage_error ( format ! ( "invalid time interval {}" , input . quote ( ) ) ) ;
3136}
3237
3338#[ test]
You can’t perform that action at this time.
0 commit comments