aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-03-01 17:09:03 -0800
committerAndrew Kelley <andrew@ziglang.org>2022-03-03 15:07:23 -0500
commit7deadf4301d5f5f5e2b8a1a8b2dc7109e2c82181 (patch)
tree9ceee5649ba2b889e2fb8cce3ca08e4b1192e10d /test/behavior
parent65943010c70b33e711a038dff5f80066045ee1b7 (diff)
downloadzig-7deadf4301d5f5f5e2b8a1a8b2dc7109e2c82181.tar.gz
zig-7deadf4301d5f5f5e2b8a1a8b2dc7109e2c82181.zip
stage2: reify error sets
Diffstat (limited to 'test/behavior')
-rw-r--r--test/behavior/type.zig9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/behavior/type.zig b/test/behavior/type.zig
index eea4d7d203..43751ff4b7 100644
--- a/test/behavior/type.zig
+++ b/test/behavior/type.zig
@@ -240,12 +240,19 @@ fn add(a: i32, b: i32) i32 {
}
test "Type.ErrorSet" {
- if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO
+ try testing.expect(@Type(TypeInfo{ .ErrorSet = null }) == anyerror);
// error sets don't compare equal so just check if they compile
_ = @Type(@typeInfo(error{}));
_ = @Type(@typeInfo(error{A}));
_ = @Type(@typeInfo(error{ A, B, C }));
+ _ = @Type(TypeInfo{
+ .ErrorSet = &[_]TypeInfo.Error{
+ .{ .name = "A" },
+ .{ .name = "B" },
+ .{ .name = "C" },
+ },
+ });
}
test "Type.Struct" {