aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2016-12-25 03:04:09 +0100
committerTharre <tharre3@gmail.com>2016-12-25 03:04:09 +0100
commit966bcc06a43b8c128b5c100b5f6f635139b48389 (patch)
tree2ccca3fd871723a45585d5763e0019d0b14b0e3e /tests
parentb39506329fbb46c5da343f20a5de7e328729da8f (diff)
downloadredo-966bcc06a43b8c128b5c100b5f6f635139b48389.tar.gz
redo-966bcc06a43b8c128b5c100b5f6f635139b48389.tar.xz
redo-966bcc06a43b8c128b5c100b5f6f635139b48389.zip
Add test case for missing directories
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0100-redo.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/t0100-redo.t b/tests/t0100-redo.t
index cc86d1b..a2b757f 100755
--- a/tests/t0100-redo.t
+++ b/tests/t0100-redo.t
@@ -34,4 +34,24 @@ test_expect_success "redo shortcuts" "
redo a
"
+cat > "nonexistant.do" << 'EOF'
+#!/bin/sh -e
+redo-ifchange nonexistant2
+cat nonexistant2 > $3
+EOF
+
+cat > "nonexistant2.do" <<'EOF'
+#!/bin/sh -e
+[ -e "dir/b" ] && redo-ifchange dir/b && cat dir/b > $3
+echo "b" >> $3
+EOF
+
+test_expect_success "redo should succeed despite missing directories" "
+ mkdir dir &&
+ echo a > dir/b &&
+ redo nonexistant &&
+ rm -rf dir &&
+ redo nonexistant
+"
+
test_done