From f459fe36ca7d365ef30e2abb0261e19d4f807e50 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sat, 25 Oct 2025 20:12:23 -0700 Subject: [PATCH] failing test for multiline function --- src/compiler/tests/compiler.test.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/compiler/tests/compiler.test.ts b/src/compiler/tests/compiler.test.ts index 603a9eb..652b29c 100644 --- a/src/compiler/tests/compiler.test.ts +++ b/src/compiler/tests/compiler.test.ts @@ -85,6 +85,21 @@ describe('compiler', () => { expect(`bloop = do: 'bloop' end; bloop`).toEvaluateTo('bloop') }) + test('function call with if statement and multiple expressions', () => { + expect(` + abc = do: + if false: + echo nope + end + + true + end + + abc + `) + .toEvaluateTo(true) + }) + test('simple conditionals', () => { expect(`(3 < 6)`).toEvaluateTo(true) expect(`(10 > 20)`).toEvaluateTo(false) @@ -139,10 +154,6 @@ describe('compiler', () => { scattered end`).toEvaluateTo('dwarf') }) - - test('single line if', () => { - expect(`if 3 < 9: shire`).toEvaluateTo('shire') - }) }) describe('errors', () => {