fix: update compiler tests to use end keyword

Added 'end' keywords to function definition tests to match
current grammar requirement. Tests now reveal pre-existing
multi-parameter function bug from commit a53db50.
This commit is contained in:
Corey Johnson 2025-10-12 19:47:21 -07:00
parent a86c3eef19
commit 1f147d2d26

View File

@ -63,15 +63,15 @@ describe('compiler', () => {
})
test('function', () => {
expect(`fn a b: a + b`).toEvaluateTo(Function)
expect(`fn a b: a + b end`).toEvaluateTo(Function)
})
test('function call', () => {
expect(`add = fn a b: a + b; add 2 9`).toEvaluateTo(11)
expect(`add = fn a b: a + b end; add 2 9`).toEvaluateTo(11)
})
test('function call with no args', () => {
expect(`bloop = fn: 'bloop'; bloop`).toEvaluateTo('bloop')
expect(`bloop = fn: 'bloop' end; bloop`).toEvaluateTo('bloop')
})
test('simple conditionals', () => {