Bugfixes, pretty printing, new tests added

Spec result: 108 specs pass, 6 skipped, 67 fail
This commit is contained in:
Tyler Akins
2023-04-09 18:53:55 -05:00
parent a1e4398547
commit e0e9189355
7 changed files with 210 additions and 49 deletions

View File

@@ -0,0 +1,3 @@
|
{{content}}
|

14
tests/list-contexts Executable file
View 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

View File

@@ -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
View 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