aboutsummaryrefslogtreecommitdiff
path: root/test/cases/errors.1.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/errors.1.zig')
-rw-r--r--test/cases/errors.1.zig18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/cases/errors.1.zig b/test/cases/errors.1.zig
new file mode 100644
index 0000000000..5f9582df8a
--- /dev/null
+++ b/test/cases/errors.1.zig
@@ -0,0 +1,18 @@
+const std = @import("std");
+
+pub fn main() void {
+ foo() catch print();
+}
+
+fn foo() anyerror!void {
+ return error.Test;
+}
+
+fn print() void {
+ _ = std.os.write(1, "Hello, World!\n") catch {};
+}
+
+// run
+//
+// Hello, World!
+//