zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 7a7f83033c3fee3e92046b76dd33b9f8ded4f0fd (tree)
parent 4e37fb2fa244e350b4e248332848d40594eee820
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Tue, 19 Apr 2016 17:19:18 -0700

add test for public enums

See #5

Diffstat:
Atest/other.zig | 5+++++
Mtest/self_hosted.zig | 10+++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/test/other.zig b/test/other.zig @@ -0,0 +1,5 @@ +pub enum APubEnum { + One, + Two, + Three, +} diff --git a/test/self_hosted.zig b/test/self_hosted.zig @@ -1,7 +1,7 @@ -// test std library const std = @import("std"); const assert = std.assert; const str = std.str; +const other = @import("other.zig"); #attribute("test") fn empty_function() {} @@ -1244,3 +1244,11 @@ fn test3_2(f: Test3Foo) { } + +#attribute("test") +fn pub_enum() { + pub_enum_test(other.APubEnum.Two); +} +fn pub_enum_test(foo: other.APubEnum) { + assert(foo == other.APubEnum.Two); +}