diff options
Diffstat (limited to 'src/comptime.zig')
| -rw-r--r-- | src/comptime.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/comptime.zig b/src/comptime.zig index 0a4257e..b9021de 100644 --- a/src/comptime.zig +++ b/src/comptime.zig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | const clap = @import("index.zig"); | 1 | const clap = @import("index.zig"); |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | const debug = std.debug; | 4 | const testing = std.testing; |
| 5 | const heap = std.heap; | 5 | const heap = std.heap; |
| 6 | const mem = std.mem; | 6 | const mem = std.mem; |
| 7 | 7 | ||
| @@ -130,12 +130,12 @@ test "clap.comptime.ComptimeClap" { | |||
| 130 | var args = try Clap.parse(&fb_allocator.allocator, clap.args.SliceIterator, &iter); | 130 | var args = try Clap.parse(&fb_allocator.allocator, clap.args.SliceIterator, &iter); |
| 131 | defer args.deinit(); | 131 | defer args.deinit(); |
| 132 | 132 | ||
| 133 | debug.assert(args.flag("-a")); | 133 | testing.expect(args.flag("-a")); |
| 134 | debug.assert(args.flag("--aa")); | 134 | testing.expect(args.flag("--aa")); |
| 135 | debug.assert(!args.flag("-b")); | 135 | testing.expect(!args.flag("-b")); |
| 136 | debug.assert(!args.flag("--bb")); | 136 | testing.expect(!args.flag("--bb")); |
| 137 | debug.assert(mem.eql(u8, args.option("-c").?, "0")); | 137 | testing.expectEqualSlices(u8, "0", args.option("-c").?); |
| 138 | debug.assert(mem.eql(u8, args.option("--cc").?, "0")); | 138 | testing.expectEqualSlices(u8, "0", args.option("--cc").?); |
| 139 | debug.assert(args.positionals().len == 1); | 139 | testing.expectEqual(usize(1), args.positionals().len); |
| 140 | debug.assert(mem.eql(u8, args.positionals()[0], "something")); | 140 | testing.expectEqualSlices(u8, "something", args.positionals()[0]); |
| 141 | } | 141 | } |