chiark / gitweb /
test suite: t-tstunt: When looking for real thing, strip stunt from PATH
[dgit.git] / tests / lib
index 0cd696b4a98681efe691f71199fc23a161a350fc..1af0288aeace7db78adc3b6518af4529dc1972af 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -392,6 +392,7 @@ t-fscks () {
 }
 
 t-ok () {
+       : '========================================'
        t-fscks
        echo ok.
 }
@@ -800,7 +801,14 @@ t-tstunt--save-real () {
        local rc
        local real
        set +e
-       real=$(type -p "$f")
+       real=$(
+               p=":$PATH:"
+               p="${p/:"$tmp/tstunt":/:}"
+               p="${p%:}"
+               p="${p#:}"
+               PATH="$p"
+               type -p "$f"
+       )
        rc=$?
        set -e