File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
System.CommandLine.Tests/Help Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1638,10 +1638,10 @@ public void Help_describes_default_values_for_subcommand_with_multiple_defaultab
16381638 [ InlineData ( 0 ) ]
16391639 [ InlineData ( - 1 ) ]
16401640 [ InlineData ( int . MinValue ) ]
1641- public void Constructor_max_width_must_be_positive ( int maxWidth )
1641+ public void Constructor_ignores_non_positive_max_width ( int maxWidth )
16421642 {
1643- var ex = Assert . Throws < ArgumentOutOfRangeException > ( ( ) => new HelpBuilder ( _console , maxWidth ) ) ;
1644- Assert . Equal ( "maxWidth" , ex . ParamName ) ;
1643+ var helpBuilder = new HelpBuilder ( _console , maxWidth ) ;
1644+ Assert . Equal ( int . MaxValue , helpBuilder . MaxWidth ) ;
16451645 }
16461646
16471647 private class CustomHelpBuilderThatAddsTextAfterDefaultText : HelpBuilder
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public class HelpBuilder : IHelpBuilder
2222 public HelpBuilder ( IConsole console , int maxWidth = int . MaxValue )
2323 {
2424 Console = console ?? throw new ArgumentNullException ( nameof ( console ) ) ;
25- if ( maxWidth <= 0 ) throw new ArgumentOutOfRangeException ( nameof ( maxWidth ) , "Max width must be positive" ) ;
25+ if ( maxWidth <= 0 ) maxWidth = int . MaxValue ;
2626 MaxWidth = maxWidth ;
2727 }
2828
You can’t perform that action at this time.
0 commit comments