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:
parent
a86c3eef19
commit
1f147d2d26
|
|
@ -63,15 +63,15 @@ describe('compiler', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
test('function', () => {
|
test('function', () => {
|
||||||
expect(`fn a b: a + b`).toEvaluateTo(Function)
|
expect(`fn a b: a + b end`).toEvaluateTo(Function)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('function call', () => {
|
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', () => {
|
test('function call with no args', () => {
|
||||||
expect(`bloop = fn: 'bloop'; bloop`).toEvaluateTo('bloop')
|
expect(`bloop = fn: 'bloop' end; bloop`).toEvaluateTo('bloop')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('simple conditionals', () => {
|
test('simple conditionals', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user