2017-01-05 00:57:48 -08:00
|
|
|
const assert = @import("std").debug.assert;
|
|
|
|
|
2017-03-16 13:02:35 -07:00
|
|
|
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")) {
|
2017-03-26 03:39:28 -07:00
|
|
|
Os.linux => @import("a.zig"),
|
|
|
|
else => @import("b.zig"),
|
2016-12-25 23:42:31 -08:00
|
|
|
};
|