diff options
| author | Jacob G-W <jacoblevgw@gmail.com> | 2021-08-17 10:49:17 -0400 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-08-19 14:09:53 +0300 |
| commit | d785dc49aa6fc422d936928e504e50a63fa37759 (patch) | |
| tree | 5d500a5e4069967b1a80442aa5bc7c3b87358513 /test | |
| parent | 2129cc5c54e76268177f3d6e8d7598a86496e265 (diff) | |
| download | zig-d785dc49aa6fc422d936928e504e50a63fa37759.tar.gz zig-d785dc49aa6fc422d936928e504e50a63fa37759.zip | |
stage2: add error set type equality
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/cases.zig b/test/cases.zig index ffff88f7d8..302246065f 100644 --- a/test/cases.zig +++ b/test/cases.zig @@ -1568,6 +1568,24 @@ pub fn addCases(ctx: *TestContext) !void { }); } { + var case = ctx.exe("error set equality", linux_x64); + + case.addCompareOutput( + \\pub fn main() void { + \\ assert(@TypeOf(error.Foo) == @TypeOf(error.Foo)); + \\ assert(@TypeOf(error.Bar) != @TypeOf(error.Foo)); + \\ assert(anyerror == anyerror); + \\ assert(error{Foo} != error{Foo}); + \\ // TODO put inferred error sets here when @typeInfo works + \\} + \\fn assert(b: bool) void { + \\ if (!b) unreachable; + \\} + , + "", + ); + } + { var case = ctx.exe("inline assembly", linux_x64); case.addError( |
