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

15 lines
376 B
Zig
Raw Normal View History

const builtin = @import("builtin");
2017-01-05 00:57:48 -08:00
const assert = @import("std").debug.assert;
2017-05-23 18:38:31 -07:00
test "namespace depends on compile var" {
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 (builtin.os) {
builtin.Os.linux => @import("a.zig"),
else => @import("b.zig"),
2016-12-25 23:42:31 -08:00
};