aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-23 00:34:47 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-23 00:34:59 -0700
commita922d5d42a3ba9bbded0740e1eb3246e7b57ad2a (patch)
treef62821f2a88dd807ca28362379cd4b1e01974275 /test/run_tests.cpp
parent1543043bf5b5633de485dccee88872a3d4f6c454 (diff)
downloadzig-a922d5d42a3ba9bbded0740e1eb3246e7b57ad2a.tar.gz
zig-a922d5d42a3ba9bbded0740e1eb3246e7b57ad2a.zip
implement literal error values
See #23
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index fe8dc39ae0..a112eeb43a 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1258,6 +1258,22 @@ pub fn main(args: [][]u8) i32 => {
}
)SOURCE", "OK\n");
+ add_simple_case("error values", R"SOURCE(
+import "std.zig";
+%.err1;
+%.err2;
+pub fn main(args: [][]u8) i32 => {
+ const a = i32(%.err1);
+ const b = i32(%.err2);
+ if (a == b) {
+ print_str("BAD\n");
+ }
+
+ print_str("OK\n");
+ return 0;
+}
+ )SOURCE", "OK\n");
+
}