summaryrefslogtreecommitdiff
path: root/tests/extended.zig
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extended.zig')
-rw-r--r--tests/extended.zig16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/extended.zig b/tests/extended.zig
index 3dbb87d..9670814 100644
--- a/tests/extended.zig
+++ b/tests/extended.zig
@@ -26,10 +26,10 @@ pub fn Test(comptime Expect: type) type {
26 Fail: error, 26 Fail: error,
27 }; 27 };
28 28
29 pub fn success(args: []const []const u8, expected: *const Expect) Self { 29 pub fn success(args: []const []const u8, expected: Expect) Self {
30 return Self{ 30 return Self{
31 .args = args, 31 .args = args,
32 .kind = Kind{ .Success = expected.* }, 32 .kind = Kind{ .Success = expected },
33 }; 33 };
34 } 34 }
35 35
@@ -40,7 +40,7 @@ pub fn Test(comptime Expect: type) type {
40 }; 40 };
41 } 41 }
42 42
43 pub fn run(t: *const Self, comptime parser: var) void { 43 pub fn run(t: Self, comptime parser: var) void {
44 var iter = ArgSliceIterator.init(t.args); 44 var iter = ArgSliceIterator.init(t.args);
45 const actual = parser.parse(ArgSliceIterator.Error, &iter.iter); 45 const actual = parser.parse(ArgSliceIterator.Error, &iter.iter);
46 46
@@ -81,7 +81,7 @@ test "clap.extended: short" {
81 res.position = 0; 81 res.position = 0;
82 break :p res; 82 break :p res;
83 }, 83 },
84 Param.option("b", Names.short('b'), &Parser.int(u8, 10)), 84 Param.option("b", Names.short('b'), Parser.int(u8, 10)),
85 }, 85 },
86 }; 86 };
87 87
@@ -172,12 +172,12 @@ test "clap.extended: long" {
172 }, 172 },
173 .params = []Param{ 173 .params = []Param{
174 p: { 174 p: {
175 var res = Param.long("a", Names.short('a')); 175 var res = Param.flag("a", Names.long("a"));
176 res.required = true; 176 res.required = true;
177 res.position = 0; 177 res.position = 0;
178 break :p res; 178 break :p res;
179 }, 179 },
180 Param.option("b", Names.long('b'), &Parser.int(u8, 10)), 180 Param.option("b", Names.long("b"), Parser.int(u8, 10)),
181 }, 181 },
182 }; 182 };
183 183
@@ -244,12 +244,12 @@ test "clap.extended: bare" {
244 }, 244 },
245 .params = []Param{ 245 .params = []Param{
246 p: { 246 p: {
247 var res = Param.bare("a", Names.short('a')); 247 var res = Param.flag("a", Names.bare("a"));
248 res.required = true; 248 res.required = true;
249 res.position = 0; 249 res.position = 0;
250 break :p res; 250 break :p res;
251 }, 251 },
252 Param.option("b", Names.bare('b'), &Parser.int(u8, 10)), 252 Param.option("b", Names.bare("b"), Parser.int(u8, 10)),
253 }, 253 },
254 }; 254 };
255 255