Allow passing arguments to functions

This commit is contained in:
2021-12-21 02:06:18 -08:00
parent bb695de69f
commit c7f7b0c6fb
4 changed files with 20 additions and 4 deletions

View File

@@ -30,6 +30,20 @@ testReferingToALightningFunctionWorks() {
assertContains "$STDOUT" "Good Bye."
}
testArgumentsArePassedToLightningFunctions() {
echo '
#!/usr/bin/env bash
⚡hello() { echo "Hello, $@!" ; }
' > go
echo "source $REPO_ROOT/⚡" >> go
chmod +x go
try ./go hello banana
assertContains "$STDOUT" "Hello, banana!"
}
testDefiningALightningFunctionWorksWithSelector16() {
echo '
#!/usr/bin/env bash