2020-02-25 06:52:27 +00:00
|
|
|
const std = @import("std");
|
2021-10-05 07:47:27 +01:00
|
|
|
const builtin = @import("builtin");
|
2020-02-25 06:52:27 +00:00
|
|
|
const expect = std.testing.expect;
|
2017-01-05 08:57:48 +00:00
|
|
|
|
2017-05-24 02:38:31 +01:00
|
|
|
test "namespace depends on compile var" {
|
2016-12-26 07:42:31 +00:00
|
|
|
if (some_namespace.a_bool) {
|
2021-05-04 19:23:22 +01:00
|
|
|
try expect(some_namespace.a_bool);
|
2016-12-26 07:42:31 +00:00
|
|
|
} else {
|
2021-05-04 19:23:22 +01:00
|
|
|
try expect(!some_namespace.a_bool);
|
2016-12-26 07:42:31 +00:00
|
|
|
}
|
|
|
|
}
|
2021-10-05 07:47:27 +01:00
|
|
|
const some_namespace = switch (builtin.os.tag) {
|
2020-02-25 06:52:27 +00:00
|
|
|
.linux => @import("namespace_depends_on_compile_var/a.zig"),
|
2019-03-02 21:46:04 +00:00
|
|
|
else => @import("namespace_depends_on_compile_var/b.zig"),
|
2016-12-26 07:42:31 +00:00
|
|
|
};
|