authorgravatar for sentrycraft123@gmail.comJan200101 <sentrycraft123@gmail.com> 2026-03-14 12:41:14+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-15 21:41:37+01:00
log43d5bea7af8933723a457da45714b144d95e2c70
treeb902ba0502376a485e6470d95ddec8be689729ad
parent584b8f281e18f509600026e18f83dfd9621fe591

test: use expectEqualStrings to check cmakedefine behavior

this has the added benefit of outputting the difference making it easier to figure out why the test is flakey. https://codeberg.org/ziglang/zig/issues/31368

1 files changed, 5 insertions(+), 5 deletions(-)

test/standalone/cmakedefine/check.zig+5-5
......@@ -1,3 +1,6 @@
1const std = @import("std");
2const builtin = @import("builtin");
3
14pub fn main(init: std.process.Init) !void {
25 const arena = init.arena.allocator();
36 const io = init.io;
......@@ -17,10 +20,7 @@ pub fn main(init: std.process.Init) !void {
1720 }
1821 const actual_without_comment = actual[comment_str.len..];
1922
20 if (true) return; // https://codeberg.org/ziglang/zig/issues/31368
23 if (builtin.os.tag == .windows) return; // https://codeberg.org/ziglang/zig/issues/30138
2124
22 if (!std.mem.eql(u8, actual_without_comment, expected)) {
23 return error.DoesNotMatch;
24 }
25 try std.testing.expectEqualStrings(expected, actual_without_comment);
2526}
26const std = @import("std");