mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-22 09:47:48 +00:00
Making tests care about whitespace
When testing #19 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:
parent
f14150c205
commit
0627cbbaf8
@ -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"
|
||||
|
@ -1,4 +1,5 @@
|
||||
name=Willy
|
||||
wrapped() {
|
||||
echo "<b>$1</b>";
|
||||
# The final newline is eaten by mo
|
||||
echo "<b>$1</b>"
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
<b> Willy is awesome.
|
||||
</b>
|
||||
</b>... this is the last line.
|
||||
|
@ -1,3 +1,4 @@
|
||||
{{#wrapped}}
|
||||
{{name}} is awesome.
|
||||
{{/wrapped}}
|
||||
... this is the last line.
|
||||
|
@ -1,4 +1,4 @@
|
||||
* Chris
|
||||
*
|
||||
* <b>GitHub</b>
|
||||
* <b>GitHub</b>
|
||||
* .Chris.
|
||||
* ..
|
||||
* .<b>GitHub</b>.
|
||||
* .<b>GitHub</b>.
|
||||
|
@ -1,4 +1,4 @@
|
||||
* {{name}}
|
||||
* {{age}}
|
||||
* {{company}}
|
||||
* {{{company}}}
|
||||
* .{{name}}.
|
||||
* .{{age}}.
|
||||
* .{{company}}.
|
||||
* .{{{company}}}.
|
||||
|
Loading…
Reference in New Issue
Block a user