From d4de35254f36cae1b4c9a2fa4c9803ee6fe80dc7 Mon Sep 17 00:00:00 2001 From: -k Date: Mon, 8 Jul 2024 23:47:07 -0700 Subject: [PATCH] test(cli): add color tests --- test/cli.zig | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/test/cli.zig b/test/cli.zig index ff52678..0af7df7 100644 --- a/test/cli.zig +++ b/test/cli.zig @@ -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 });