commit d12537b56374b00f6a7faed0bc704eb55f3d085e
parent 804e51f0a2986dd9cbb6c3637aad962112531624
Author: Kyle Milz <kyle@0x30.net>
Date: Thu, 28 Jul 2016 20:35:11 -0600
t: hang onto the binary paths before unsetting PATH
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/t/inst_nopath.t b/t/inst_nopath.t
@@ -3,16 +3,17 @@
# Test that not having PATH set errors out.
#
echo 1..2
-unset PATH
-
tmpfile=`mktemp`
+grep=`which grep`
+
+unset PATH
src/gcc -c nomatter.c 2> $tmpfile
if [ $? -eq 1 ]; then
echo ok 1
fi
-if grep -q "PATH must be set" $tmpfile; then
+if $grep -q "PATH must be set" $tmpfile; then
echo ok 2
fi