Allow passing arguments to functions
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user