Making tests care about whitespace

When testing  I found that the tests were mistakenly ignoring some
whitespace changes. I've enabled whitespace checks and had to update the
tests because my editor likes newlines at the end of files and removes
whitespace at the end of lines. To make the test files easier to manage,
I've modified some scenarios to still test for the feature but also work
with the whitespace modifications that editors would perform.
This commit is contained in:
Tyler Akins 2017-08-02 10:35:35 -05:00
parent f14150c205
commit 0627cbbaf8
No known key found for this signature in database
GPG Key ID: 8F3B8C432F4393BD
7 changed files with 14 additions and 12 deletions

View File

@ -21,7 +21,7 @@ for TEST in tests/*.expected; do
. "${BASE}.env"
echo "Do not read this input" | mo "${BASE}.template"
fi
) | diff -wU5 - "${TEST}" > "${BASE}.diff"
) | diff -U5 - "${TEST}" > "${BASE}.diff"
if [[ $? -ne 0 ]]; then
echo "FAIL"

View File

@ -1,4 +1,5 @@
name=Willy
wrapped() {
echo "<b>$1</b>";
# The final newline is eaten by mo
echo "<b>$1</b>"
}

View File

@ -1,2 +1,2 @@
<b> Willy is awesome.
</b>
</b>... this is the last line.

View File

@ -1,3 +1,4 @@
{{#wrapped}}
{{name}} is awesome.
{{/wrapped}}
... this is the last line.

View File

@ -1,4 +1,4 @@
* Chris
*
* <b>GitHub</b>
* <b>GitHub</b>
* .Chris.
* ..
* .<b>GitHub</b>.
* .<b>GitHub</b>.

View File

@ -1,4 +1,4 @@
* {{name}}
* {{age}}
* {{company}}
* {{{company}}}
* .{{name}}.
* .{{age}}.
* .{{company}}.
* .{{{company}}}.