diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-08 10:34:45 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-08 10:34:45 -0500 |
| commit | 5a8d87f5042b5ab86de7c72df4ce84a314878e40 (patch) | |
| tree | d9a8e14011994c5ebdf4525ea5c5b647aae91a6e /test/cases/error.zig | |
| parent | 38658a597bc22697c2038c21bdec9f04c9973eb8 (diff) | |
| parent | 598170756cd91b6f300921d256baa72141ec3098 (diff) | |
| download | zig-5a8d87f5042b5ab86de7c72df4ce84a314878e40.tar.gz zig-5a8d87f5042b5ab86de7c72df4ce84a314878e40.zip | |
Merge branch 'master' into llvm6
Diffstat (limited to 'test/cases/error.zig')
| -rw-r--r-- | test/cases/error.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/cases/error.zig b/test/cases/error.zig index 3974e9dc7c..dbe96366d3 100644 --- a/test/cases/error.zig +++ b/test/cases/error.zig @@ -2,7 +2,7 @@ const assert = @import("std").debug.assert; const mem = @import("std").mem; pub fn foo() -> %i32 { - const x = %return bar(); + const x = try bar(); return x + 1; } @@ -11,7 +11,7 @@ pub fn bar() -> %i32 { } pub fn baz() -> %i32 { - const y = foo() %% 1234; + const y = foo() catch 1234; return y + 1; } @@ -53,8 +53,8 @@ fn shouldBeNotEqual(a: error, b: error) { test "error binary operator" { - const a = errBinaryOperatorG(true) %% 3; - const b = errBinaryOperatorG(false) %% 3; + const a = errBinaryOperatorG(true) catch 3; + const b = errBinaryOperatorG(false) catch 3; assert(a == 3); assert(b == 10); } @@ -77,7 +77,7 @@ test "error return in assignment" { fn doErrReturnInAssignment() -> %void { var x : i32 = undefined; - x = %return makeANonErr(); + x = try makeANonErr(); } fn makeANonErr() -> %i32 { |
