Skip to content

Commit

Permalink
test: fix live cases
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Sep 27, 2024
1 parent e3004e5 commit 6854276
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions test/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test "default" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.default);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.default);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -54,7 +54,7 @@ test "accents" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.accents);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.accents);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -66,7 +66,7 @@ test "speed" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.default);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.default);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -78,7 +78,7 @@ test "mode: decimal" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.decimal);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.decimal);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -90,7 +90,7 @@ test "mode: hexadecimal" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.hexadecimal);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.hexadecimal);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -102,7 +102,7 @@ test "mode: textual" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.textual);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.textual);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -114,7 +114,7 @@ test "color: red" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.red);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.red);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -126,7 +126,7 @@ test "color: green" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.green);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.green);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -137,7 +137,8 @@ test "color: blue" {
std.testing.allocator.free(proc.out);
std.testing.allocator.free(proc.err);
}
try std.testing.expectStringEndsWith(proc.err, streams.blue);

if (!live) try std.testing.expectStringEndsWith(proc.err, streams.blue);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -149,7 +150,7 @@ test "color: yellow" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.yellow);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.yellow);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -161,7 +162,7 @@ test "color: magenta" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.magenta);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.magenta);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -173,7 +174,7 @@ test "style: columns" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.columns);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.columns);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -185,7 +186,7 @@ test "style: crypto" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.crypto);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.crypto);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -197,7 +198,7 @@ test "style: grid" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.grid);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.grid);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -209,7 +210,7 @@ test "style: blocks" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.blocks);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.blocks);
try std.testing.expectEqual(proc.term.Exited, 0);
}

Expand All @@ -221,6 +222,6 @@ test "style: rain" {
std.testing.allocator.free(proc.err);
}

try std.testing.expectStringEndsWith(proc.err, streams.rain);
if (!live) try std.testing.expectStringEndsWith(proc.err, streams.rain);
try std.testing.expectEqual(proc.term.Exited, 0);
}

0 comments on commit 6854276

Please sign in to comment.