From: Brendan Hansen Date: Mon, 11 Dec 2023 17:14:46 +0000 (-0600) Subject: added: test case for #82 X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=078a570aa6d627228c8294c76a7765e5e7cf4ab6;p=onyx.git added: test case for #82 --- 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 b/tests/nested_array_literals new file mode 100644 index 00000000..5f97376e --- /dev/null +++ b/tests/nested_array_literals @@ -0,0 +1,2 @@ +[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] +[ [ 0, 1, 2, 3 ], [ 1, 2, 3, 4 ], [ 2, 3, 4, 5 ] ] diff --git a/tests/nested_array_literals.txt b/tests/nested_array_literals.txt deleted file mode 100644 index 5f97376e..00000000 --- a/tests/nested_array_literals.txt +++ /dev/null @@ -1,2 +0,0 @@ -[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] -[ [ 0, 1, 2, 3 ], [ 1, 2, 3, 4 ], [ 2, 3, 4, 5 ] ]