@@ -1095,6 +1095,80 @@ extension HelpGenerationTests {
10951095 """ )
10961096 }
10971097
1098+ struct CustomOptionAsListWithSingleDefaultValue : ParsableCommand {
1099+ @Option (
1100+ help: " An option with enumerable values. " )
1101+ var opt : [ OptionValues ] = [ . red]
1102+ }
1103+
1104+ func testEnumerableOptionAsListWithSingleDefault( ) {
1105+ AssertHelp (
1106+ . default,
1107+ for: CustomOptionAsListWithSingleDefaultValue . self,
1108+ columns: 100 ,
1109+ equals: """
1110+ USAGE: custom-option-as-list-with-single-default-value [--opt <opt> ...]
1111+
1112+ OPTIONS:
1113+ --opt <opt> An option with enumerable values. (default: red)
1114+ blue - The color of the sky.
1115+ red - The color of a rose.
1116+ yellow - The color of the sun.
1117+ -h, --help Show help information.
1118+
1119+ """ )
1120+ }
1121+
1122+ struct CustomOptionAsListWithMultipleDefaultValue : ParsableCommand {
1123+ @Option (
1124+ help: " An option with multiple enumerable values. " )
1125+ var opt : [ OptionValues ] = [ . red, . blue]
1126+ }
1127+
1128+ func testEnumerableOptionAsListWithMultipleDefault( ) {
1129+ AssertHelp (
1130+ . default,
1131+ for: CustomOptionAsListWithMultipleDefaultValue . self,
1132+ columns: 100 ,
1133+ equals: """
1134+ USAGE: custom-option-as-list-with-multiple-default-value [--opt <opt> ...]
1135+
1136+ OPTIONS:
1137+ --opt <opt> An option with multiple enumerable values. (default: red, blue)
1138+ blue - The color of the sky.
1139+ red - The color of a rose.
1140+ yellow - The color of the sun.
1141+ -h, --help Show help information.
1142+
1143+ """ )
1144+
1145+ }
1146+
1147+ struct CustomOptionAsListWithEmptyArrayAsDefault : ParsableCommand {
1148+ @Option (
1149+ help: " An option with default value set to empty array. " )
1150+ var opt : [ OptionValues ] = [ ]
1151+ }
1152+
1153+ func testEnumerableOptionAsListWithEmptyArrayAsDefault( ) {
1154+ AssertHelp (
1155+ . default,
1156+ for: CustomOptionAsListWithEmptyArrayAsDefault . self,
1157+ columns: 100 ,
1158+ equals: """
1159+ USAGE: custom-option-as-list-with-empty-array-as-default [--opt <opt> ...]
1160+
1161+ OPTIONS:
1162+ --opt <opt> An option with default value set to empty array.
1163+ blue - The color of the sky.
1164+ red - The color of a rose.
1165+ yellow - The color of the sun.
1166+ -h, --help Show help information.
1167+
1168+ """ )
1169+
1170+ }
1171+
10981172 struct CustomOptionWithDefault : ParsableCommand {
10991173 @Option ( help: " An option with enumerable values and a custom default. " )
11001174 var opt : OptionValues = . red
0 commit comments