From 078a570aa6d627228c8294c76a7765e5e7cf4ab6 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 11 Dec 2023 11:14:46 -0600 Subject: [PATCH] added: test case for #82 --- tests/do_block_single_statement | 3 +++ tests/do_block_single_statement.onyx | 19 +++++++++++++++++++ ...ray_literals.txt => nested_array_literals} | 0 3 files changed, 22 insertions(+) create mode 100644 tests/do_block_single_statement create mode 100644 tests/do_block_single_statement.onyx rename tests/{nested_array_literals.txt => nested_array_literals} (100%) diff --git a/tests/do_block_single_statement b/tests/do_block_single_statement new file mode 100644 index 00000000..7a0eb550 --- /dev/null +++ b/tests/do_block_single_statement @@ -0,0 +1,3 @@ +1 +10 +10.0000 diff --git a/tests/do_block_single_statement.onyx b/tests/do_block_single_statement.onyx new file mode 100644 index 00000000..6fc76873 --- /dev/null +++ b/tests/do_block_single_statement.onyx @@ -0,0 +1,19 @@ +use core {println} + +main :: () { + // 'x' should be set to 1, but the compiler hangs/crashes. + // removing 'do' has the same issue. + x := do if true { + return 1; + } else { + return 2; + }; + + y := do return 10;; // Needing double ';' is gross here. + + z := do -> f32 return 10;; + + println(x); + println(y); + println(z); +} \ No newline at end of file diff --git a/tests/nested_array_literals.txt b/tests/nested_array_literals similarity index 100% rename from tests/nested_array_literals.txt rename to tests/nested_array_literals -- 2.25.1