zig/test/behavior/pub_enum.zig

14 lines
325 B
Zig
Raw Normal View History

2019-03-02 21:46:04 +00:00
const other = @import("pub_enum/other.zig");
const expect = @import("std").testing.expect;
2016-12-26 07:42:31 +00:00
2017-05-24 02:38:31 +01:00
test "pub enum" {
try pubEnumTest(other.APubEnum.Two);
2016-12-26 07:42:31 +00:00
}
fn pubEnumTest(foo: other.APubEnum) !void {
try expect(foo == other.APubEnum.Two);
2016-12-26 07:42:31 +00:00
}
2017-05-24 02:38:31 +01:00
test "cast with imported symbol" {
try expect(@as(other.size_t, 42) == 42);
2016-12-26 07:42:31 +00:00
}