| author | |
| committer | |
| log | e5fd8efcb60cd0223a7dd5e5825d3b9efc006c2a |
| tree | 6ca553b9da2b45bdf1157e915951a56c600f9c88 |
| parent | 183976b242dac0731caa7d925e88ad151a4dc8ee |
9 files changed, 41 insertions(+), 38 deletions(-)
test/a.zig deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | pub const a_bool = true; |
test/b.zig deleted-1| ... | ... | @@ -1 +0,0 @@ |
| 1 | pub const a_bool = false; |
test/cases/namespace_depends_on_compile_var/a.zig created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | pub const a_bool = true; |
test/cases/namespace_depends_on_compile_var/b.zig created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | pub const a_bool = false; |
test/cases/namespace_depends_on_compile_var/index.zig created+16| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | const assert = @import("std").debug.assert; | |
| 2 | ||
| 3 | #attribute("test") | |
| 4 | fn namespaceDependsOnCompileVar() { | |
| 5 | if (some_namespace.a_bool) { | |
| 6 | assert(some_namespace.a_bool); | |
| 7 | } else { | |
| 8 | assert(!some_namespace.a_bool); | |
| 9 | } | |
| 10 | } | |
| 11 | const some_namespace = switch(@compileVar("os")) { | |
| 12 | linux => @import("a.zig"), | |
| 13 | else => @import("b.zig"), | |
| 14 | }; | |
| 15 | ||
| 16 |
test/cases/pub_enum/index.zig created+17| ... | ... | @@ -0,0 +1,17 @@ |
| 1 | const assert = @import("std").debug.assert; | |
| 2 | const other = @import("other.zig"); | |
| 3 | ||
| 4 | #attribute("test") | |
| 5 | fn pubEnum() { | |
| 6 | pubEnumTest(other.APubEnum.Two); | |
| 7 | } | |
| 8 | fn pubEnumTest(foo: other.APubEnum) { | |
| 9 | assert(foo == other.APubEnum.Two); | |
| 10 | } | |
| 11 | ||
| 12 | #attribute("test") | |
| 13 | fn castWithImportedSymbol() { | |
| 14 | assert(other.size_t(42) == 42); | |
| 15 | } | |
| 16 | ||
| 17 |
test/cases/pub_enum/other.zig created+6| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | pub enum APubEnum { | |
| 2 | One, | |
| 3 | Two, | |
| 4 | Three, | |
| 5 | } | |
| 6 | pub const size_t = u64; |
test/other.zig deleted-6| ... | ... | @@ -1,6 +0,0 @@ |
| 1 | pub enum APubEnum { | |
| 2 | One, | |
| 3 | Two, | |
| 4 | Three, | |
| 5 | } | |
| 6 | pub const size_t = u64; |
test/self_hosted.zig-30| ... | ... | @@ -2,7 +2,6 @@ const std = @import("std"); |
| 2 | 2 | const assert = std.debug.assert; |
| 3 | 3 | const str = std.str; |
| 4 | 4 | const cstr = std.cstr; |
| 5 | const other = @import("other.zig"); | |
| 6 | 5 | // TODO '_' identifier for unused variable bindings |
| 7 | 6 | const test_return_type_type = @import("cases/return_type_type.zig"); |
| 8 | 7 | const test_zeroes = @import("cases/zeroes.zig"); |
| ... | ... | @@ -1242,21 +1241,6 @@ fn test3_2(f: Test3Foo) { |
| 1242 | 1241 | |
| 1243 | 1242 | |
| 1244 | 1243 | |
| 1245 | #attribute("test") | |
| 1246 | fn pubEnum() { | |
| 1247 | pubEnumTest(other.APubEnum.Two); | |
| 1248 | } | |
| 1249 | fn pubEnumTest(foo: other.APubEnum) { | |
| 1250 | assert(foo == other.APubEnum.Two); | |
| 1251 | } | |
| 1252 | ||
| 1253 | ||
| 1254 | #attribute("test") | |
| 1255 | fn castWithImportedSymbol() { | |
| 1256 | assert(other.size_t(42) == 42); | |
| 1257 | } | |
| 1258 | ||
| 1259 | ||
| 1260 | 1244 | #attribute("test") |
| 1261 | 1245 | fn whileWithContinueExpr() { |
| 1262 | 1246 | var sum: i32 = 0; |
| ... | ... | @@ -1637,20 +1621,6 @@ fn aGenericFn(inline T: type, inline a: T, b: T) -> T { |
| 1637 | 1621 | } |
| 1638 | 1622 | |
| 1639 | 1623 | |
| 1640 | #attribute("test") | |
| 1641 | fn namespaceDependsOnCompileVar() { | |
| 1642 | if (some_namespace.a_bool) { | |
| 1643 | assert(some_namespace.a_bool); | |
| 1644 | } else { | |
| 1645 | assert(!some_namespace.a_bool); | |
| 1646 | } | |
| 1647 | } | |
| 1648 | const some_namespace = switch(@compileVar("os")) { | |
| 1649 | linux => @import("a.zig"), | |
| 1650 | else => @import("b.zig"), | |
| 1651 | }; | |
| 1652 | ||
| 1653 | ||
| 1654 | 1624 | #attribute("test") |
| 1655 | 1625 | fn unsigned64BitDivision() { |
| 1656 | 1626 | const result = div(1152921504606846976, 34359738365); |