authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-27 00:09:43-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-27 00:09:43-04:00
loge5fd8efcb60cd0223a7dd5e5825d3b9efc006c2a
tree6ca553b9da2b45bdf1157e915951a56c600f9c88
parent183976b242dac0731caa7d925e88ad151a4dc8ee

clean up test directory


9 files changed, 41 insertions(+), 38 deletions(-)

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