|
@@ -9,32 +9,32 @@ fi
|
|
|
|
|
|
|
|
# Clean up previous test data
|
|
# Clean up previous test data
|
|
|
|
|
|
|
|
-if [ -f tests/cmd/$1.toml ]; then
|
|
|
|
|
- rm tests/cmd/$1.toml
|
|
|
|
|
|
|
+if [ -f tests/cmd/"$1".toml ]; then
|
|
|
|
|
+ rm tests/cmd/"$1".toml
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-if [ -f tests/cmd/$1.stdout ]; then
|
|
|
|
|
- rm tests/cmd/$1.stdout
|
|
|
|
|
|
|
+if [ -f tests/cmd/"$1".stdout ]; then
|
|
|
|
|
+ rm tests/cmd/"$1".stdout
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-if [ -f tests/cmd/$1.stderr ]; then
|
|
|
|
|
- rm tests/cmd/$1.stderr
|
|
|
|
|
|
|
+if [ -f tests/cmd/"$1".stderr ]; then
|
|
|
|
|
+ rm tests/cmd/"$1".stderr
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Generate test data
|
|
# Generate test data
|
|
|
|
|
|
|
|
-touch tests/cmd/$1.toml
|
|
|
|
|
|
|
+touch tests/cmd/"$1".toml
|
|
|
|
|
|
|
|
-echo 'bin.name = "eza"' >> tests/cmd/$1.toml
|
|
|
|
|
-echo 'args = "'$2'"' >> tests/cmd/$1.toml
|
|
|
|
|
|
|
+echo 'bin.name = "eza"' >> tests/cmd/"$1".toml
|
|
|
|
|
+echo 'args = "'"$2"'"' >> tests/cmd/"$1".toml
|
|
|
|
|
|
|
|
# Generate expected output
|
|
# Generate expected output
|
|
|
|
|
|
|
|
if [ -f target/debug/eza ]; then
|
|
if [ -f target/debug/eza ]; then
|
|
|
- target/debug/eza $2 > tests/cmd/$1.stdout 2> tests/cmd/$1.stderr
|
|
|
|
|
|
|
+ target/debug/eza "$2" > tests/cmd/"$1".stdout 2> tests/cmd/"$1".stderr
|
|
|
returncode=$?
|
|
returncode=$?
|
|
|
if [ $returncode -ne 0 ]; then
|
|
if [ $returncode -ne 0 ]; then
|
|
|
- echo -e 'status.code = '$returncode'' >> tests/cmd/$1.toml
|
|
|
|
|
|
|
+ echo -e 'status.code = '$returncode'' >> tests/cmd/"$1".toml
|
|
|
exit 0
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
else
|
|
else
|