diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-02-01 20:54:48 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-02-01 20:54:48 -0700 |
| commit | 02162934306fb72474671367254fd50763a390d4 (patch) | |
| tree | 786c515279cc98a1d9fabeb087150e499b846331 /test/run_tests.cpp | |
| parent | d8d0f656541620525e5ed94ed60fbdab13693b1f (diff) | |
| download | zig-02162934306fb72474671367254fd50763a390d4.tar.gz zig-02162934306fb72474671367254fd50763a390d4.zip | |
add test for var local eval const expr
closes #53
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index da8e011b3d..7a58668d2d 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1501,6 +1501,18 @@ export fn main(argc: c_int, argv: &&u8) -> c_int { return 0; } )SOURCE", "3.25\n3\n3.00\n-0.40\n"); + + + add_simple_case("const expression eval handling of variables", R"SOURCE( +import "std.zig"; +pub fn main(args: [][]u8) -> %void { + var x = true; + while (x) { + x = false; + } + %%stdout.printf("OK\n"); +} + )SOURCE", "OK\n"); } |
