]> Cypherpunks.ru repositories - goredo.git/blobdiff - t/apenwarr/260-whichdo/exists.do
More apenwarr/redo redo-whichdo behaviour resembling
[goredo.git] / t / apenwarr / 260-whichdo / exists.do
diff --git a/t/apenwarr/260-whichdo/exists.do b/t/apenwarr/260-whichdo/exists.do
new file mode 100644 (file)
index 0000000..49a6592
--- /dev/null
@@ -0,0 +1,25 @@
+exec >&2
+
+a=$(cd fakesub && redo-whichdo ../a/b/x.y.z)
+# if sh doesn't abort after the above, then it found a .do file as expected
+
+# Note: we expect redo-whichdo to return paths relative to $PWD at the time
+# it's run, which in this case is fakesub.
+# Likely bugs would be to return paths relative to the start dir, the .redo
+# dir, the current target dir, the requested target dir, etc.
+b=$(cat <<EOF
+../a/b/x.y.z.do
+../a/b/default.y.z.do
+../a/b/default.z.do
+../a/b/default.do
+../a/default.y.z.do
+../a/default.z.do
+../a/default.do
+../default.y.z.do
+EOF
+)
+
+if [ "$a" != "$b" ]; then
+    printf 'redo-whichdo mismatch.\n\ngot:\n%s\n\nexpected:\n%s\n' "$a" "$b"
+    exit 11
+fi