2017-05-01 10:12:38 -07:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2018-04-30 17:35:54 -07:00
|
|
|
const some_namespace = switch (builtin.os) {
|
2017-05-01 10:12:38 -07:00
|
|
|
builtin.Os.linux => @import("a.zig"),
|
2017-03-26 03:39:28 -07:00
|
|
|
else => @import("b.zig"),
|
2016-12-25 23:42:31 -08:00
|
|
|
};
|