diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-03-16 16:02:35 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-03-16 16:02:35 -0400 |
| commit | af536ac343564e5120f99cbf3b7fc9efa984eb93 (patch) | |
| tree | 42a937bca75d34e2d3b4fc7d44ebafa66d8bd55b /test/cases/while.zig | |
| parent | 329457bb4f714a8392153dfecfabd6f356144688 (diff) | |
| download | zig-af536ac343564e5120f99cbf3b7fc9efa984eb93.tar.gz zig-af536ac343564e5120f99cbf3b7fc9efa984eb93.zip | |
introduce new test syntax
* remove setFnTest builtin
* add test "name" { ... } syntax
* remove --check-unused argument. functions are always lazy now.
Diffstat (limited to 'test/cases/while.zig')
| -rw-r--r-- | test/cases/while.zig | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/test/cases/while.zig b/test/cases/while.zig index e5e10e5568..c3b7a84722 100644 --- a/test/cases/while.zig +++ b/test/cases/while.zig @@ -1,8 +1,6 @@ const assert = @import("std").debug.assert; -fn whileLoop() { - @setFnTest(this); - +test "whileLoop" { var i : i32 = 0; while (i < 4) { i += 1; @@ -18,9 +16,7 @@ fn whileLoop2() -> i32 { return 1; } } -fn staticEvalWhile() { - @setFnTest(this); - +test "staticEvalWhile" { assert(static_eval_while_number == 1); } const static_eval_while_number = staticWhileLoop1(); @@ -33,9 +29,7 @@ fn staticWhileLoop2() -> i32 { } } -fn continueAndBreak() { - @setFnTest(this); - +test "continueAndBreak" { runContinueAndBreakTest(); assert(continue_and_break_counter == 8); } @@ -53,9 +47,7 @@ fn runContinueAndBreakTest() { assert(i == 4); } -fn returnWithImplicitCastFromWhileLoop() { - @setFnTest(this); - +test "returnWithImplicitCastFromWhileLoop" { %%returnWithImplicitCastFromWhileLoopTest(); } fn returnWithImplicitCastFromWhileLoopTest() -> %void { @@ -64,9 +56,7 @@ fn returnWithImplicitCastFromWhileLoopTest() -> %void { } } -fn whileWithContinueExpr() { - @setFnTest(this); - +test "whileWithContinueExpr" { var sum: i32 = 0; {var i: i32 = 0; while (i < 10; i += 1) { if (i == 5) continue; |
