mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-18 16:27:52 +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"
|
. "${BASE}.env"
|
||||||
echo "Do not read this input" | mo "${BASE}.template"
|
echo "Do not read this input" | mo "${BASE}.template"
|
||||||
fi
|
fi
|
||||||
) | diff -wU5 - "${TEST}" > "${BASE}.diff"
|
) | diff -U5 - "${TEST}" > "${BASE}.diff"
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "FAIL"
|
echo "FAIL"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
name=Willy
|
name=Willy
|
||||||
wrapped() {
|
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> Willy is awesome.
|
||||||
</b>
|
</b>... this is the last line.
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
{{#wrapped}}
|
{{#wrapped}}
|
||||||
{{name}} is awesome.
|
{{name}} is awesome.
|
||||||
{{/wrapped}}
|
{{/wrapped}}
|
||||||
|
... this is the last line.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
* Chris
|
* .Chris.
|
||||||
*
|
* ..
|
||||||
* <b>GitHub</b>
|
* .<b>GitHub</b>.
|
||||||
* <b>GitHub</b>
|
* .<b>GitHub</b>.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
* {{name}}
|
* .{{name}}.
|
||||||
* {{age}}
|
* .{{age}}.
|
||||||
* {{company}}
|
* .{{company}}.
|
||||||
* {{{company}}}
|
* .{{{company}}}.
|
||||||
|
@ -1 +1 @@
|
|||||||
multilineData=$'line 1\nline2'
|
multilineData=$'line 1\nline 2'
|
||||||
|
Loading…
Reference in New Issue
Block a user