2023-05-11 09:23:34 +03:30
|
|
|
const builtin = @import("builtin");
|
2019-03-02 16:46:04 -05:00
|
|
|
const other = @import("pub_enum/other.zig");
|
2019-02-08 18:18:47 -05:00
|
|
|
const expect = @import("std").testing.expect;
|
2016-12-26 02:42:31 -05:00
|
|
|
|
2017-05-23 21:38:31 -04:00
|
|
|
test "pub enum" {
|
2025-06-16 01:16:15 +03:30
|
|
|
if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
|
2024-04-13 23:11:32 -07:00
|
|
|
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
2024-01-13 18:44:44 +01:00
|
|
|
|
2021-05-04 21:23:22 +03:00
|
|
|
try pubEnumTest(other.APubEnum.Two);
|
2016-12-26 02:42:31 -05:00
|
|
|
}
|
2021-05-04 21:23:22 +03:00
|
|
|
fn pubEnumTest(foo: other.APubEnum) !void {
|
|
|
|
|
try expect(foo == other.APubEnum.Two);
|
2016-12-26 02:42:31 -05:00
|
|
|
}
|
|
|
|
|
|
2017-05-23 21:38:31 -04:00
|
|
|
test "cast with imported symbol" {
|
2025-06-16 01:16:15 +03:30
|
|
|
if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest;
|
2024-04-13 23:11:32 -07:00
|
|
|
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
2024-01-13 18:44:44 +01:00
|
|
|
|
2021-05-04 21:23:22 +03:00
|
|
|
try expect(@as(other.size_t, 42) == 42);
|
2016-12-26 02:42:31 -05:00
|
|
|
}
|