summaryrefslogtreecommitdiff
path: root/basename
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2018-10-01 20:44:36 +0200
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2018-10-01 20:44:36 +0200
commit7ee3f5a2230b05feb6cf1173a9514bd09821d740 (patch)
tree9a11b5f2387e02495b37d480817c32d493e133bb /basename
parentd70bbc3548276a9a25e14b2e7e5ae1d9e53992f8 (diff)
* refactor basename test case
Diffstat (limited to 'basename')
-rw-r--r--basename/all.do9
1 files changed, 5 insertions, 4 deletions
diff --git a/basename/all.do b/basename/all.do
index 3075f47..fd034d3 100644
--- a/basename/all.do
+++ b/basename/all.do
@@ -4,9 +4,10 @@ TARGETS="directory/target directory/target.xyz"
for TARGET in ${TARGETS}; do
mv "${TARGET}" "${TARGET}.old"
redo-ifchange "${TARGET}"
- read -r FILENAME BASENAME TEMPFILE <"${TARGET}"
- case "${BASENAME}" in
- target) echo "PASS: \${BASENAME} = target" >&2 ;;
- *) echo "FAIL: \${BASENAME} != target" >&2 ;;
+ REAL_BASENAME=$(basename "${TARGET}" .xyz)
+ read -r REDO_ABSPATH REDO_BASENAME REDO_TMPFILE <"${TARGET}"
+ case "${REDO_BASENAME}" in
+ "${REAL_BASENAME}") echo "PASS: \${2} = ${REAL_BASENAME}" >&2 ;;
+ *) echo "FAIL: \${2} = ${REDO_BASENAME} != ${REAL_BASENAME}" >&2 ;;
esac
done