mirror of
https://github.com/tests-always-included/mo.git
synced 2025-11-19 23:34:32 +01:00
Passes all of the tests
This commit is contained in:
@@ -3,6 +3,7 @@ cd "${0%/*}" || exit 1
|
||||
. ../run-tests
|
||||
|
||||
arguments=(-- --help)
|
||||
returnCode=1
|
||||
template=""
|
||||
expected="cat: --help: No such file or directory"$'\n'
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ testArgs() {
|
||||
template() {
|
||||
cat <<EOF
|
||||
No args: {{testArgs}} - done
|
||||
One arg: {{testArgs one}} - done
|
||||
Getting name in a string: {{testArgs "The name is $name"}} - done
|
||||
Reverse this: {{#pipeTo rev}}abcde{{/pipeTo}}
|
||||
One arg: {{testArgs 'one'}} - done
|
||||
Getting name in a string: {{testArgs {"The name is " name}}} - done
|
||||
Reverse this: {{#pipeTo "rev"}}abcde{{/pipeTo}}
|
||||
EOF
|
||||
}
|
||||
expected() {
|
||||
|
||||
@@ -3,22 +3,23 @@ cd "${0%/*}" || exit 1
|
||||
. ../run-tests
|
||||
|
||||
testArgs() {
|
||||
echo "$MO_FUNCTION_ARGS"
|
||||
local args=$(declare -p MO_FUNCTION_ARGS)
|
||||
echo "${args#*=}"
|
||||
}
|
||||
template() {
|
||||
cat <<EOF
|
||||
No args: [{{testArgs}}] - done
|
||||
One arg: [{{testArgs one}}] - done
|
||||
Multiple arguments: [{{testArgs aa bb cc 'x' " ! {[_.| }}] - done
|
||||
Evil: [{{testArgs bla; cat /etc/issue}}] - done
|
||||
No args: {{testArgs}} - done
|
||||
One arg: {{testArgs 'one'}} - done
|
||||
Multiple arguments: {{testArgs 'aa' 'bb' 'cc' 'x' "" '!' '{[_.|' }} - done
|
||||
Evil: {{testArgs bla; cat /etc/issue}} - done
|
||||
EOF
|
||||
}
|
||||
expected() {
|
||||
cat <<EOF
|
||||
No args: [] - done
|
||||
One arg: [one] - done
|
||||
Multiple arguments: [aa bb cc 'x' " ! {[_.|] - done
|
||||
Evil: [bla; cat /etc/issue] - done
|
||||
No args: () - done
|
||||
One arg: ([0]="one") - done
|
||||
Multiple arguments: ([0]="aa" [1]="bb" [2]="cc" [3]="x" [4]="" [5]="!" [6]="{[_.|") - done
|
||||
Evil: ([0]="" [1]="" [2]="") - done
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ Options:
|
||||
-s=FILE, --source=FILE
|
||||
Load FILE into the environment before processing templates.
|
||||
Can be used multiple times.
|
||||
-d, --debug
|
||||
Enable debug logging to stderr.
|
||||
|
||||
MO_VERSION=3.0.0
|
||||
EOF
|
||||
|
||||
@@ -4,6 +4,7 @@ cd "${0%/*}" || exit 1
|
||||
|
||||
person=""
|
||||
template=""
|
||||
returnCode=1
|
||||
arguments=(--something)
|
||||
expected() {
|
||||
cat <<EOF
|
||||
|
||||
@@ -7,7 +7,7 @@ template() {
|
||||
cat <<EOF
|
||||
<h2>Names</h2>
|
||||
{{#names}}
|
||||
{{> partial.partial}}
|
||||
{{> fixtures/partial.partial}}
|
||||
{{/names}}
|
||||
EOF
|
||||
}
|
||||
@@ -15,7 +15,6 @@ expected() {
|
||||
cat <<EOF
|
||||
<h2>Names</h2>
|
||||
<strong>Tyler</strong>
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user