diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-01-22 16:02:08 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-01-22 16:02:08 -0700 |
| commit | b61406b60738555cd267542f446a5f4cdf50e0b2 (patch) | |
| tree | b5180ba65a9769684e54d36d6ce3d2d1eaca318d /test/run_tests.cpp | |
| parent | 272fe1c54c76ddab2dbecc2b302a651929c4b994 (diff) | |
| download | zig-b61406b60738555cd267542f446a5f4cdf50e0b2.tar.gz zig-b61406b60738555cd267542f446a5f4cdf50e0b2.zip | |
add test for const number literal
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 6457395e44..a48120ef63 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1207,6 +1207,25 @@ pub fn main(args: [][]u8) i32 => { return 0; } )SOURCE", "OK\n"); + + add_simple_case("const number literal", R"SOURCE( +import "std.zig"; + +const ten = 10; + +pub fn main(args: [][]u8) i32 => { + const one = 1; + const eleven = ten + one; + + if (eleven != 11) { + print_str("BAD\n"); + } + + print_str("OK\n"); + return 0; +} + )SOURCE", "OK\n"); + } |
