add test for public enums

See #5
This commit is contained in:
Andrew Kelley 2016-04-19 17:19:18 -07:00
parent 4e37fb2fa2
commit 7a7f83033c
2 changed files with 14 additions and 1 deletions

5
test/other.zig Normal file
View File

@ -0,0 +1,5 @@
pub enum APubEnum {
One,
Two,
Three,
}

View File

@ -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);
}