Skip to content

Commit

Permalink
test(cli): add color tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Jul 9, 2024
1 parent c4a3aca commit d4de352
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,35 @@ fn runner(args: anytype) !std.process.Child.Term {
}

test "default" {
const argv = [_][]const u8{ exe_path, "--time=short", "-s=default" };
const argv = [_][]const u8{ exe_path, "--time=short", "-s=default", "-c=default" };
const term = try runner(argv);

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
}

test "color: red" {
const argv = [_][]const u8{ exe_path, "--time=short", "-c=red" };
const term = try runner(argv);

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
}

test "color: green" {
const argv = [_][]const u8{ exe_path, "--time=short", "-c=green" };
const term = try runner(argv);

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
}

test "color: blue" {
const argv = [_][]const u8{ exe_path, "--time=short", "-c=blue" };
const term = try runner(argv);

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
}

test "color: yellow" {
const argv = [_][]const u8{ exe_path, "--time=short", "-c=yellow" };
const term = try runner(argv);

try std.testing.expectEqual(term, std.process.Child.Term{ .Exited = 0 });
Expand Down

0 comments on commit d4de352

Please sign in to comment.