From e5fd8efcb60cd0223a7dd5e5825d3b9efc006c2a Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 27 Sep 2016 00:09:43 -0400 Subject: clean up test directory --- test/a.zig | 1 - test/b.zig | 1 - test/cases/namespace_depends_on_compile_var/a.zig | 1 + test/cases/namespace_depends_on_compile_var/b.zig | 1 + .../namespace_depends_on_compile_var/index.zig | 16 ++++++++++++ test/cases/pub_enum/index.zig | 17 ++++++++++++ test/cases/pub_enum/other.zig | 6 +++++ test/other.zig | 6 ----- test/self_hosted.zig | 30 ---------------------- 9 files changed, 41 insertions(+), 38 deletions(-) delete mode 100644 test/a.zig delete mode 100644 test/b.zig create mode 100644 test/cases/namespace_depends_on_compile_var/a.zig create mode 100644 test/cases/namespace_depends_on_compile_var/b.zig create mode 100644 test/cases/namespace_depends_on_compile_var/index.zig create mode 100644 test/cases/pub_enum/index.zig create mode 100644 test/cases/pub_enum/other.zig delete mode 100644 test/other.zig (limited to 'test') diff --git a/test/a.zig b/test/a.zig deleted file mode 100644 index 5ce0e94f8b..0000000000 --- a/test/a.zig +++ /dev/null @@ -1 +0,0 @@ -pub const a_bool = true; diff --git a/test/b.zig b/test/b.zig deleted file mode 100644 index a12a54b589..0000000000 --- a/test/b.zig +++ /dev/null @@ -1 +0,0 @@ -pub const a_bool = false; diff --git a/test/cases/namespace_depends_on_compile_var/a.zig b/test/cases/namespace_depends_on_compile_var/a.zig new file mode 100644 index 0000000000..5ce0e94f8b --- /dev/null +++ b/test/cases/namespace_depends_on_compile_var/a.zig @@ -0,0 +1 @@ +pub const a_bool = true; diff --git a/test/cases/namespace_depends_on_compile_var/b.zig b/test/cases/namespace_depends_on_compile_var/b.zig new file mode 100644 index 0000000000..a12a54b589 --- /dev/null +++ b/test/cases/namespace_depends_on_compile_var/b.zig @@ -0,0 +1 @@ +pub const a_bool = false; diff --git a/test/cases/namespace_depends_on_compile_var/index.zig b/test/cases/namespace_depends_on_compile_var/index.zig new file mode 100644 index 0000000000..d6c7313e88 --- /dev/null +++ b/test/cases/namespace_depends_on_compile_var/index.zig @@ -0,0 +1,16 @@ +const assert = @import("std").debug.assert; + +#attribute("test") +fn namespaceDependsOnCompileVar() { + if (some_namespace.a_bool) { + assert(some_namespace.a_bool); + } else { + assert(!some_namespace.a_bool); + } +} +const some_namespace = switch(@compileVar("os")) { + linux => @import("a.zig"), + else => @import("b.zig"), +}; + + diff --git a/test/cases/pub_enum/index.zig b/test/cases/pub_enum/index.zig new file mode 100644 index 0000000000..7767c94002 --- /dev/null +++ b/test/cases/pub_enum/index.zig @@ -0,0 +1,17 @@ +const assert = @import("std").debug.assert; +const other = @import("other.zig"); + +#attribute("test") +fn pubEnum() { + pubEnumTest(other.APubEnum.Two); +} +fn pubEnumTest(foo: other.APubEnum) { + assert(foo == other.APubEnum.Two); +} + +#attribute("test") +fn castWithImportedSymbol() { + assert(other.size_t(42) == 42); +} + + diff --git a/test/cases/pub_enum/other.zig b/test/cases/pub_enum/other.zig new file mode 100644 index 0000000000..da09843d34 --- /dev/null +++ b/test/cases/pub_enum/other.zig @@ -0,0 +1,6 @@ +pub enum APubEnum { + One, + Two, + Three, +} +pub const size_t = u64; diff --git a/test/other.zig b/test/other.zig deleted file mode 100644 index da09843d34..0000000000 --- a/test/other.zig +++ /dev/null @@ -1,6 +0,0 @@ -pub enum APubEnum { - One, - Two, - Three, -} -pub const size_t = u64; diff --git a/test/self_hosted.zig b/test/self_hosted.zig index 80fe018461..777de7f29e 100644 --- a/test/self_hosted.zig +++ b/test/self_hosted.zig @@ -2,7 +2,6 @@ const std = @import("std"); const assert = std.debug.assert; const str = std.str; const cstr = std.cstr; -const other = @import("other.zig"); // TODO '_' identifier for unused variable bindings const test_return_type_type = @import("cases/return_type_type.zig"); const test_zeroes = @import("cases/zeroes.zig"); @@ -1242,21 +1241,6 @@ fn test3_2(f: Test3Foo) { -#attribute("test") -fn pubEnum() { - pubEnumTest(other.APubEnum.Two); -} -fn pubEnumTest(foo: other.APubEnum) { - assert(foo == other.APubEnum.Two); -} - - -#attribute("test") -fn castWithImportedSymbol() { - assert(other.size_t(42) == 42); -} - - #attribute("test") fn whileWithContinueExpr() { var sum: i32 = 0; @@ -1637,20 +1621,6 @@ fn aGenericFn(inline T: type, inline a: T, b: T) -> T { } -#attribute("test") -fn namespaceDependsOnCompileVar() { - if (some_namespace.a_bool) { - assert(some_namespace.a_bool); - } else { - assert(!some_namespace.a_bool); - } -} -const some_namespace = switch(@compileVar("os")) { - linux => @import("a.zig"), - else => @import("b.zig"), -}; - - #attribute("test") fn unsigned64BitDivision() { const result = div(1152921504606846976, 34359738365); -- cgit v1.2.3