forked from lix-project/lix
Fix race condition in the language tests
When we pipe to `>(...)` like that, we unfortunately don't wait for the process to finish. Better to just substitute the file. Also, use the "unified" diff output that people (including myself) are more familiar with, thanks to Git.
This commit is contained in:
parent
cafb5e8a17
commit
e072e18475
tests
|
@ -52,9 +52,10 @@ for i in lang/parse-okay-*.nix; do
|
|||
i=$(basename "$i" .nix)
|
||||
if
|
||||
expect 0 nix-instantiate --parse - < "lang/$i.nix" \
|
||||
1> >(sed "s!$(pwd)!/pwd!g" > "lang/$i.out") \
|
||||
2> >(sed "s!$(pwd)!/pwd!g" > "lang/$i.err")
|
||||
1> "lang/$i.out" \
|
||||
2> "lang/$i.err"
|
||||
then
|
||||
sed "s!$(pwd)!/pwd!g" "lang/$i.out" "lang/$i.err"
|
||||
diffAndAccept "$i" out exp
|
||||
diffAndAccept "$i" err err.exp
|
||||
else
|
||||
|
|
|
@ -16,7 +16,7 @@ function diffAndAcceptInner() {
|
|||
fi
|
||||
|
||||
# Diff so we get a nice message
|
||||
if ! diff "$got" "$expectedOrEmpty"; then
|
||||
if ! diff --unified "$got" "$expectedOrEmpty"; then
|
||||
echo "FAIL: evaluation result of $testName not as expected"
|
||||
badDiff=1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue