mirror of
https://github.com/tests-always-included/mo.git
synced 2025-11-19 23:34:32 +01:00
Bugfixes, pretty printing, new tests added
Spec result: 108 specs pass, 6 skipped, 67 fail
This commit is contained in:
3
tests/fixtures/standalone-indentation.partial
vendored
Normal file
3
tests/fixtures/standalone-indentation.partial
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
|
|
||||
{{content}}
|
||||
|
|
||||
14
tests/list-contexts
Executable file
14
tests/list-contexts
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
cd "${0%/*}" || exit 1
|
||||
. ../run-tests
|
||||
|
||||
a=foo
|
||||
b=wrong
|
||||
declare -A sec
|
||||
sec=([b]="bar")
|
||||
declare -A c
|
||||
c=([d]="baz")
|
||||
template="{{#sec}}{{a}} {{b}} {{c.d}}{{/sec}}"
|
||||
expected="foo bar baz"
|
||||
|
||||
runTest
|
||||
@@ -24,8 +24,9 @@ line 2
|
||||
Indented:
|
||||
|
||||
line 1
|
||||
line 2
|
||||
line 2
|
||||
EOF
|
||||
# This one looks odd, but if you check the spec spec/specs/partials.yaml, name "Standalone Indentation" (mirrors "standalone-indentation" in tests/), then the spec clearly shows that the indentation is applied before rendering.
|
||||
}
|
||||
|
||||
runTest
|
||||
|
||||
24
tests/standalone-indentation
Executable file
24
tests/standalone-indentation
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
cd "${0%/*}" || exit 1
|
||||
. ../run-tests
|
||||
|
||||
content=$'<\n->'
|
||||
template() {
|
||||
cat <<EOF
|
||||
\
|
||||
{{>fixtures/standalone-indentation.partial}}
|
||||
/
|
||||
EOF
|
||||
}
|
||||
expected() {
|
||||
cat <<EOF
|
||||
\
|
||||
|
|
||||
<
|
||||
->
|
||||
|
|
||||
/
|
||||
EOF
|
||||
}
|
||||
|
||||
runTest
|
||||
Reference in New Issue
Block a user