From ffc593b8082eb0fa83b1a3d1b63c840379911cd5 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 24 Dec 2015 14:41:00 -0700 Subject: [PATCH] add test for while loop --- test/run_tests.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/run_tests.cpp b/test/run_tests.cpp index 9df3951979..a4a2d8ae68 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -646,6 +646,18 @@ export fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 { return 0; } )SOURCE", "OK\n"); + + add_simple_case("while loop", R"SOURCE( +use "std.zig"; +export fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 { + var i : i32 = 0; + while i < 4 { + print_str("loop\n"); + i += 1; + } + return 0; +} + )SOURCE", "loop\nloop\nloop\nloop\n"); } static void add_compile_failure_test_cases(void) {