summaryrefslogtreecommitdiff
path: root/tests/myed_test.sh
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2018-05-30 06:29:18 +0100
committerKatolaZ <katolaz@freaknet.org>2018-05-30 06:29:18 +0100
commit652ef404582555d9f7fca855424108a57cdea3ad (patch)
treeb9106730be79381027b50fd48bd3b99c5400a6ac /tests/myed_test.sh
parent8a4e57da301445ae4ad7bf06a7ce18c3091ac9df (diff)
Reimplemented (and fixed) insert/append
Diffstat (limited to 'tests/myed_test.sh')
-rwxr-xr-xtests/myed_test.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/myed_test.sh b/tests/myed_test.sh
new file mode 100755
index 0000000..4c551a4
--- /dev/null
+++ b/tests/myed_test.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+##set -x
+
+FIN=${1:-"/dev/stdin"}
+
+while read EDFILE EDSOURCE; do
+
+
+ IGN=$(echo ${EDFILE} | grep -c "^#")
+ if [ $IGN = "0" ]; then
+ printf "test: $EDFILE..."
+
+ FILE1=$(tempfile)
+ FILE2=$(tempfile)
+
+ cat ${EDFILE} | /bin/ed ${EDSOURCE} > ${FILE1} 2>/dev/null
+ cat ${EDFILE} | ../myed ${EDSOURCE} > ${FILE2} 2>/dev/null
+
+ ret=$(diff $FILE1 $FILE2 | tee ${EDFILE}.last_diff | wc -l)
+
+ [ "$ret" = "0" ] && echo " PASSED" && rm ${EDFILE}.last_diff
+
+ [ "$ret" != "0" ] && echo " FAILED (log in ${EDFILE}.last_diff)"
+ rm $FILE1 $FILE2
+ else
+ echo "${EDFILE}: SKIPPED"
+ fi
+
+
+
+
+done <$FIN