zig/test/cases/namespace_depends_on_compil.../index.zig

14 lines
334 B
Zig
Raw Normal View History

2017-01-05 00:57:48 -08:00
const assert = @import("std").debug.assert;
test "namespaceDependsOnCompileVar" {
2016-12-25 23:42:31 -08:00
if (some_namespace.a_bool) {
assert(some_namespace.a_bool);
} else {
assert(!some_namespace.a_bool);
}
}
const some_namespace = switch(@compileVar("os")) {
Os.linux => @import("a.zig"),
else => @import("b.zig"),
2016-12-25 23:42:31 -08:00
};