aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/error.zig
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@getgoogleoff.me>2023-06-15 13:14:16 +0600
committerAndrew Kelley <andrew@ziglang.org>2023-06-19 12:34:42 -0700
commit50339f595aa6ec96760b1cd9f8d0e0bfc3f167fc (patch)
tree9e2b95d8e111e905e00511962dfd32c8e5bb3245 /test/behavior/error.zig
parenta6c8ee5231230947c928bbe1c6a39eb6e1bb9c5b (diff)
downloadzig-50339f595aa6ec96760b1cd9f8d0e0bfc3f167fc.tar.gz
zig-50339f595aa6ec96760b1cd9f8d0e0bfc3f167fc.zip
all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Diffstat (limited to 'test/behavior/error.zig')
-rw-r--r--test/behavior/error.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/behavior/error.zig b/test/behavior/error.zig
index c61cd70e6b..14b0eca030 100644
--- a/test/behavior/error.zig
+++ b/test/behavior/error.zig
@@ -16,8 +16,8 @@ fn expectError(expected_err: anyerror, observed_err_union: anytype) !void {
}
test "error values" {
- const a = @errorToInt(error.err1);
- const b = @errorToInt(error.err2);
+ const a = @intFromError(error.err1);
+ const b = @intFromError(error.err2);
try expect(a != b);
}
@@ -259,14 +259,14 @@ fn testComptimeTestErrorEmptySet(x: EmptyErrorSet!i32) !void {
}
test "comptime err to int of error set with only 1 possible value" {
- testErrToIntWithOnePossibleValue(error.A, @errorToInt(error.A));
- comptime testErrToIntWithOnePossibleValue(error.A, @errorToInt(error.A));
+ testErrToIntWithOnePossibleValue(error.A, @intFromError(error.A));
+ comptime testErrToIntWithOnePossibleValue(error.A, @intFromError(error.A));
}
fn testErrToIntWithOnePossibleValue(
x: error{A},
comptime value: u32,
) void {
- if (@errorToInt(x) != value) {
+ if (@intFromError(x) != value) {
@compileError("bad");
}
}