@@ -829,14 +829,6 @@ fn multi_level_sc_help() {
829829 utils:: assert_output ( cmd, "ctest help subcmd multi" , MULTI_SC_HELP , false ) ;
830830}
831831
832- #[ test]
833- fn no_wrap_help ( ) {
834- let cmd = Command :: new ( "ctest" )
835- . term_width ( 0 )
836- . override_help ( MULTI_SC_HELP ) ;
837- utils:: assert_output ( cmd, "ctest --help" , & format ! ( "{}\n " , MULTI_SC_HELP ) , false ) ;
838- }
839-
840832#[ test]
841833fn no_wrap_default_help ( ) {
842834 let cmd = Command :: new ( "ctest" ) . version ( "1.0" ) . term_width ( 0 ) ;
@@ -2857,6 +2849,50 @@ OPTIONS:
28572849 utils:: assert_eq ( EXPECTED , String :: from_utf8 ( buf) . unwrap ( ) ) ;
28582850}
28592851
2852+ #[ test]
2853+ fn parent_cmd_req_ignored_when_negates_reqs ( ) {
2854+ static MULTI_SC_HELP : & str = "ctest-subcmd
2855+
2856+ USAGE:
2857+ ctest subcmd
2858+
2859+ OPTIONS:
2860+ -h, --help Print help information
2861+ " ;
2862+
2863+ let cmd = Command :: new ( "ctest" )
2864+ . arg ( arg ! ( <input>) )
2865+ . subcommand_negates_reqs ( true )
2866+ . subcommand ( Command :: new ( "subcmd" ) ) ;
2867+ utils:: assert_output ( cmd, "ctest subcmd --help" , MULTI_SC_HELP , false ) ;
2868+ }
2869+
2870+ #[ test]
2871+ fn parent_cmd_req_ignored_when_conflicts ( ) {
2872+ static MULTI_SC_HELP : & str = "ctest-subcmd
2873+
2874+ USAGE:
2875+ ctest subcmd
2876+
2877+ OPTIONS:
2878+ -h, --help Print help information
2879+ " ;
2880+
2881+ let cmd = Command :: new ( "ctest" )
2882+ . arg ( arg ! ( <input>) )
2883+ . args_conflicts_with_subcommands ( true )
2884+ . subcommand ( Command :: new ( "subcmd" ) ) ;
2885+ utils:: assert_output ( cmd, "ctest subcmd --help" , MULTI_SC_HELP , false ) ;
2886+ }
2887+
2888+ #[ test]
2889+ fn no_wrap_help ( ) {
2890+ let cmd = Command :: new ( "ctest" )
2891+ . term_width ( 0 )
2892+ . override_help ( MULTI_SC_HELP ) ;
2893+ utils:: assert_output ( cmd, "ctest --help" , & format ! ( "{}\n " , MULTI_SC_HELP ) , false ) ;
2894+ }
2895+
28602896#[ test]
28612897fn display_name_default ( ) {
28622898 let mut cmd = Command :: new ( "app" ) . bin_name ( "app.exe" ) ;
0 commit comments