File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2031,6 +2031,27 @@ Options:
20312031 utils:: assert_output ( app2, "default --help" , expected, false ) ;
20322032}
20332033
2034+ #[ test]
2035+ fn empty_default_value ( ) {
2036+ let app = Command :: new ( "default" ) . version ( "0.1" ) . term_width ( 120 ) . arg (
2037+ Arg :: new ( "argument" )
2038+ . help ( "Pass an argument to the program." )
2039+ . long ( "arg" )
2040+ . default_value ( "" ) ,
2041+ ) ;
2042+
2043+ let expected = str![ [ r#"
2044+ Usage: default [OPTIONS]
2045+
2046+ Options:
2047+ --arg <argument> Pass an argument to the program. [default: ]
2048+ -h, --help Print help
2049+ -V, --version Print version
2050+
2051+ "# ] ] ;
2052+ utils:: assert_output ( app, "default --help" , expected, false ) ;
2053+ }
2054+
20342055#[ test]
20352056#[ cfg( feature = "wrap_help" ) ]
20362057fn escaped_whitespace_values ( ) {
You can’t perform that action at this time.
0 commit comments