Fixed EOF bug when processing empty files

This commit is contained in:
Mike Farah
2021-07-16 20:56:22 +10:00
parent 171ca2e053
commit a13617407e
3 changed files with 24 additions and 3 deletions

View File

@@ -113,6 +113,20 @@ if [[ $X != $expected ]]; then
exit 1
fi
# handle empty files
./yq e '.' examples/empty.yaml
if [[ $? != 0 ]]; then
echo "Expected no error when processing empty file but got one"
exit 1
fi
cat examples/empty.yaml | ./yq e '.' -
if [[ $? != 0 ]]; then
echo "Expected no error when processing empty stdin but got one"
exit 1
fi
echo "--success"
set -e