zig/test/behavior/namespace_depends_on_compile_var.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

15 lines
423 B
Zig

const std = @import("std");
const expect = std.testing.expect;
test "namespace depends on compile var" {
if (some_namespace.a_bool) {
expect(some_namespace.a_bool);
} else {
expect(!some_namespace.a_bool);
}
}
const some_namespace = switch (std.builtin.os.tag) {
.linux => @import("namespace_depends_on_compile_var/a.zig"),
else => @import("namespace_depends_on_compile_var/b.zig"),
};