Compare commits
No commits in common. "fe6f54b4024312f8f3152d5d0d985b00ada144c0" and "49f3f3e09f441aa3d3807c579ccd6bbda571f721" have entirely different histories.
fe6f54b402
...
49f3f3e09f
|
|
@ -10,7 +10,7 @@
|
||||||
"repl": "bun generate-parser && bun bin/repl",
|
"repl": "bun generate-parser && bun bin/repl",
|
||||||
"update-reef": "rm -rf ~/.bun/install/cache/ && rm bun.lock && bun update reefvm",
|
"update-reef": "rm -rf ~/.bun/install/cache/ && rm bun.lock && bun update reefvm",
|
||||||
"cli:install": "ln -s \"$(pwd)/bin/shrimp\" ~/.bun/bin/shrimp",
|
"cli:install": "ln -s \"$(pwd)/bin/shrimp\" ~/.bun/bin/shrimp",
|
||||||
"cli:remove": "rm ~/.bun/bin/shrimp"
|
"cli:remove": "rm ~/.bun/bin/shrimp",
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/view": "^6.38.3",
|
"@codemirror/view": "^6.38.3",
|
||||||
|
|
|
||||||
|
|
@ -301,23 +301,6 @@ describe('default params', () => {
|
||||||
expect('multiply = do x y=5: x * y end; multiply 5 2').toEvaluateTo(10)
|
expect('multiply = do x y=5: x * y end; multiply 5 2').toEvaluateTo(10)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('null triggers default value', () => {
|
|
||||||
expect('test = do n=true: n end; test').toEvaluateTo(true)
|
|
||||||
expect('test = do n=true: n end; test false').toEvaluateTo(false)
|
|
||||||
expect('test = do n=true: n end; test null').toEvaluateTo(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('null triggers default for named parameters', () => {
|
|
||||||
expect("greet = do name='World': name end; greet name=null").toEvaluateTo('World')
|
|
||||||
expect("greet = do name='World': name end; greet name='Bob'").toEvaluateTo('Bob')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('null triggers default with multiple parameters', () => {
|
|
||||||
expect('calc = do x=10 y=20: x + y end; calc null 5').toEvaluateTo(15)
|
|
||||||
expect('calc = do x=10 y=20: x + y end; calc 3 null').toEvaluateTo(23)
|
|
||||||
expect('calc = do x=10 y=20: x + y end; calc null null').toEvaluateTo(30)
|
|
||||||
})
|
|
||||||
|
|
||||||
test.skip('array default', () => {
|
test.skip('array default', () => {
|
||||||
expect('abc = do alpha=[a b c]: alpha end; abc').toEvaluateTo(['a', 'b', 'c'])
|
expect('abc = do alpha=[a b c]: alpha end; abc').toEvaluateTo(['a', 'b', 'c'])
|
||||||
expect('abc = do alpha=[a b c]: alpha end; abc [x y z]').toEvaluateTo(['x', 'y', 'z'])
|
expect('abc = do alpha=[a b c]: alpha end; abc [x y z]').toEvaluateTo(['x', 'y', 'z'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user