zig/test/cases/namespace_depends_on_compile_var/index.zig
Andrew Kelley a35b366eb6 [breaking] delete ptr deref prefix op
start using zig-fmt-pointer-reform branch build of zig fmt
to fix code to use the new syntax

all of test/cases/* are processed, but there are more left
to be done - all the std lib used by the behavior tests
2018-04-30 20:35:54 -04:00

15 lines
376 B
Zig

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