diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-04-19 17:19:18 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-04-19 17:20:23 -0700 |
| commit | 7a7f83033c3fee3e92046b76dd33b9f8ded4f0fd (patch) | |
| tree | 7cf7451ce0809bc59961325d338e6b4b1d2b07fe | |
| parent | 4e37fb2fa244e350b4e248332848d40594eee820 (diff) | |
| download | zig-7a7f83033c3fee3e92046b76dd33b9f8ded4f0fd.tar.gz zig-7a7f83033c3fee3e92046b76dd33b9f8ded4f0fd.zip | |
add test for public enums
See #5
| -rw-r--r-- | test/other.zig | 5 | ||||
| -rw-r--r-- | test/self_hosted.zig | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/other.zig b/test/other.zig new file mode 100644 index 0000000000..3e82b9ef0e --- /dev/null +++ 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 index 92f87c1f99..74fb23c464 100644 --- 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); +} |
