Fix tests

Broken in 5d5182ede3
This commit is contained in:
Yorhel 2025-03-05 10:44:12 +01:00
parent 0918096301
commit 5438312440

View file

@ -727,13 +727,13 @@ test "argument parser" {
const T = struct { const T = struct {
a: Args, a: Args,
fn opt(self: *@This(), isopt: bool, val: []const u8) !void { fn opt(self: *@This(), isopt: bool, val: []const u8) !void {
const o = self.a.next().?; const o = (self.a.next() catch unreachable).?;
try std.testing.expectEqual(isopt, o.opt); try std.testing.expectEqual(isopt, o.opt);
try std.testing.expectEqualStrings(val, o.val); try std.testing.expectEqualStrings(val, o.val);
try std.testing.expectEqual(o.is(val), isopt); try std.testing.expectEqual(o.is(val), isopt);
} }
fn arg(self: *@This(), val: []const u8) !void { fn arg(self: *@This(), val: []const u8) !void {
try std.testing.expectEqualStrings(val, self.a.arg()); try std.testing.expectEqualStrings(val, self.a.arg() catch unreachable);
} }
}; };
var t = T{ .a = Args.init(&lst) }; var t = T{ .a = Args.init(&lst) };