@@ -14,7 +14,7 @@ test "positional arguments with auto index" {
1414 try app .rootCommand ().addArg (Arg .positional ("TWO" , null , null ));
1515 try app .rootCommand ().addArg (Arg .positional ("THREE" , null , null ));
1616
17- const matches = try app .parseFrom (&.{ "val1" , "val2" , "val3" });
17+ const matches = try app .parseFrom (std . testing . io , &.{ "val1" , "val2" , "val3" });
1818 try testing .expectEqualStrings ("val1" , matches .getSingleValue ("ONE" ).? );
1919 try testing .expectEqualStrings ("val2" , matches .getSingleValue ("TWO" ).? );
2020 try testing .expectEqualStrings ("val3" , matches .getSingleValue ("THREE" ).? );
@@ -30,7 +30,7 @@ test "positional arguments with manual index" {
3030 try app .rootCommand ().addArg (Arg .positional ("THREE" , null , 3 ));
3131 try app .rootCommand ().addArg (Arg .positional ("TWO" , null , 2 ));
3232
33- const matches = try app .parseFrom (&.{ "val1" , "val2" , "val3" });
33+ const matches = try app .parseFrom (std . testing . io , &.{ "val1" , "val2" , "val3" });
3434 try testing .expectEqualStrings ("val1" , matches .getSingleValue ("ONE" ).? );
3535 try testing .expectEqualStrings ("val2" , matches .getSingleValue ("TWO" ).? );
3636 try testing .expectEqualStrings ("val3" , matches .getSingleValue ("THREE" ).? );
@@ -57,7 +57,7 @@ test "command that takes single value" {
5757
5858 try app .rootCommand ().addArg (Arg .positional ("PATH" , null , 1 ));
5959
60- const matches = try app .parseFrom (&.{"test.txt" });
60+ const matches = try app .parseFrom (std . testing . io , &.{"test.txt" });
6161 try testing .expectEqualStrings ("test.txt" , matches .getSingleValue ("PATH" ).? );
6262
6363 app .deinit ();
@@ -117,7 +117,7 @@ test "command that takes required positional arg" {
117117
118118 try app .rootCommand ().addArg (Arg .positional ("PATH" , null , null ));
119119 app .rootCommand ().setProperty (.positional_arg_required );
120- try testing .expectError (error .PositionalArgumentNotProvided , app .parseFrom (&.{}));
120+ try testing .expectError (error .PositionalArgumentNotProvided , app .parseFrom (std . testing . io , &.{}));
121121
122122 app .deinit ();
123123}
@@ -128,7 +128,7 @@ test "command requires subcommand" {
128128
129129 try app .rootCommand ().addSubcommand (app .createCommand ("init" , null ));
130130 app .rootCommand ().setProperty (.subcommand_required );
131- try testing .expectError (error .SubcommandNotProvided , app .parseFrom (&.{}));
131+ try testing .expectError (error .SubcommandNotProvided , app .parseFrom (std . testing . io , &.{}));
132132
133133 app .deinit ();
134134}
@@ -138,7 +138,7 @@ test "Option that does not takes value" {
138138 errdefer app .deinit ();
139139
140140 try app .rootCommand ().addArg (Arg .booleanOption ("version" , 'v' , null ));
141- try testing .expectError (error .UnexpectedOptionValue , app .parseFrom (&.{"-v=13" }));
141+ try testing .expectError (error .UnexpectedOptionValue , app .parseFrom (std . testing . io , &.{"-v=13" }));
142142
143143 app .deinit ();
144144}
@@ -148,7 +148,7 @@ test "Option that takes single value" {
148148 errdefer app .deinit ();
149149
150150 try app .rootCommand ().addArg (Arg .singleValueOption ("output" , 'o' , null ));
151- try testing .expectError (error .OptionValueNotProvided , app .parseFrom (&.{"-o" }));
151+ try testing .expectError (error .OptionValueNotProvided , app .parseFrom (std . testing . io , &.{"-o" }));
152152
153153 app .deinit ();
154154}
@@ -162,7 +162,7 @@ test "multiValuesOption provided with single value short" {
162162 // ex: clang sources...
163163 try app .rootCommand ().addArg (srcs );
164164
165- const matches_short = try app .parseFrom (&.{ "-s" , "f1" });
165+ const matches_short = try app .parseFrom (std . testing . io , &.{ "-s" , "f1" });
166166 try testing .expectEqual (@as (usize , 1 ), matches_short .getMultiValues ("sources" ).? .len );
167167}
168168
@@ -175,7 +175,7 @@ test "multiValuesOption provided with single value long" {
175175 // ex: clang sources...
176176 try app .rootCommand ().addArg (srcs );
177177
178- const matches_short = try app .parseFrom (&.{ "--sources" , "f1" });
178+ const matches_short = try app .parseFrom (std . testing . io , &.{ "--sources" , "f1" });
179179 try testing .expectEqual (@as (usize , 1 ), matches_short .getMultiValues ("sources" ).? .len );
180180}
181181
@@ -187,7 +187,7 @@ test "multiValuesOption provided with multiple values short" {
187187
188188 // ex: clang sources...
189189 try app .rootCommand ().addArg (srcs );
190- const matches = try app .parseFrom (&.{ "-s" , "f1" , "f2" , "f3" , "f4" , "f5" });
190+ const matches = try app .parseFrom (std . testing . io , &.{ "-s" , "f1" , "f2" , "f3" , "f4" , "f5" });
191191
192192 try testing .expectEqual (@as (usize , 5 ), matches .getMultiValues ("sources" ).? .len );
193193}
@@ -200,7 +200,7 @@ test "multiValuesOption provided with multiple values long" {
200200
201201 // ex: clang sources...
202202 try app .rootCommand ().addArg (srcs );
203- const matches = try app .parseFrom (&.{ "--sources" , "f1" , "f2" , "f3" , "f4" , "f5" });
203+ const matches = try app .parseFrom (std . testing . io , &.{ "--sources" , "f1" , "f2" , "f3" , "f4" , "f5" });
204204
205205 try testing .expectEqual (@as (usize , 5 ), matches .getMultiValues ("sources" ).? .len );
206206}
@@ -217,7 +217,7 @@ test "Option that takes many/multiple values" {
217217
218218 // ex: clang sources...
219219 try app .rootCommand ().addArg (srcs );
220- const matches = try app .parseFrom (&.{ "-s" , "f1" , "f2" , "f3" , "f4" , "f5" });
220+ const matches = try app .parseFrom (std . testing . io , &.{ "-s" , "f1" , "f2" , "f3" , "f4" , "f5" });
221221
222222 try testing .expectEqual (@as (usize , 5 ), matches .getMultiValues ("sources" ).? .len );
223223
@@ -235,7 +235,7 @@ test "Option with min values" {
235235 srcs .setProperty (.takes_value );
236236
237237 try app .rootCommand ().addArg (srcs );
238- try testing .expectError (error .TooFewOptionValue , app .parseFrom (&.{"-s=f1" }));
238+ try testing .expectError (error .TooFewOptionValue , app .parseFrom (std . testing . io , &.{"-s=f1" }));
239239
240240 app .deinit ();
241241}
@@ -249,6 +249,7 @@ test "Option with max values" {
249249
250250 try app .rootCommand ().addArg (srcs );
251251 try testing .expectError (error .TooManyOptionValue , app .parseFrom (
252+ std .testing .io ,
252253 &.{"-s=f1:f2:f3:f4:f5:f6" },
253254 ));
254255
@@ -267,7 +268,7 @@ test "Option with allowed values" {
267268 );
268269
269270 try app .rootCommand ().addArg (stdd );
270- try testing .expectError (error .InvalidOptionValue , app .parseFrom (&.{"--std=c100" }));
271+ try testing .expectError (error .InvalidOptionValue , app .parseFrom (std . testing . io , &.{"--std=c100" }));
271272
272273 app .deinit ();
273274}
@@ -280,7 +281,7 @@ test "passing positional argument before options" {
280281 try app .rootCommand ().addArg (Arg .booleanOption ("all" , 'a' , null ));
281282 app .rootCommand ().setProperty (.positional_arg_required );
282283
283- const matches = try app .parseFrom (&.{ "." , "-a" });
284+ const matches = try app .parseFrom (std . testing . io , &.{ "." , "-a" });
284285 try testing .expectEqualStrings ("." , matches .getSingleValue ("PATH" ).? );
285286 try testing .expectEqual (true , matches .containsArg ("all" ));
286287
@@ -294,7 +295,7 @@ test "passing positional argument after options" {
294295 try app .rootCommand ().addArg (Arg .positional ("PATH" , null , null ));
295296 try app .rootCommand ().addArg (Arg .booleanOption ("all" , 'a' , null ));
296297
297- const matches = try app .parseFrom (&.{ "-a" , "." });
298+ const matches = try app .parseFrom (std . testing . io , &.{ "-a" , "." });
298299 try testing .expectEqualStrings ("." , matches .getSingleValue ("PATH" ).? );
299300 try testing .expectEqual (true , matches .containsArg ("all" ));
300301
@@ -309,7 +310,7 @@ test "passing positional argument before and after options" {
309310 try app .rootCommand ().addArg (Arg .booleanOption ("all" , 'a' , null ));
310311 try app .rootCommand ().addArg (Arg .booleanOption ("one-line" , '1' , null ));
311312
312- const matches = try app .parseFrom (&.{ "-1" , "." , "-a" });
313+ const matches = try app .parseFrom (std . testing . io , &.{ "-1" , "." , "-a" });
313314 try testing .expectEqualStrings ("." , matches .getSingleValue ("PATH" ).? );
314315 try testing .expectEqual (true , matches .containsArg ("one-line" ));
315316 try testing .expectEqual (true , matches .containsArg ("all" ));
0 commit comments