[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated
From: |
Ken Hornstein |
Subject: |
[Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 87e2eacc63f1ecc60d58a01921cdcf8b1aa55171 |
Date: |
Sat, 24 Mar 2012 03:22:23 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The nmh Mail Handling System".
The branch, master has been updated
via 87e2eacc63f1ecc60d58a01921cdcf8b1aa55171 (commit)
from c915e11a95bdfb6157eecc81c5df82de65c86796 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/nmh.git/commit/?id=87e2eacc63f1ecc60d58a01921cdcf8b1aa55171
commit 87e2eacc63f1ecc60d58a01921cdcf8b1aa55171
Author: Ken Hornstein <address@hidden>
Date: Fri Mar 23 23:21:35 2012 -0400
Modify the whatnow tests to deal with different versions of readline;
some echo the input, some do not.
diff --git a/test/whatnow/test-attach-detach b/test/whatnow/test-attach-detach
index 3ac5f3b..fe5785c 100755
--- a/test/whatnow/test-attach-detach
+++ b/test/whatnow/test-attach-detach
@@ -32,18 +32,44 @@ actual=$MH_TEST_DIR/$$.actual
rm -f $expected $expectederr $actual $actualerr
touch $expected $expectederr $actual $actualerr
-cat > $expected <<EOF
+#
+# Sigh. Different readline versions change echoing behavior, so we need
+# to deal.
+#
+
+set +e
+whatnowtest="$(echo cd | TERM=dumb whatnow -prompt '')"
+set -e
+
+case "${whatnowtest}" in
+ cd) cat > "$expected" <<EOF
+attach $testname_quoted
+alist
+$testname
+detach $testname_quoted
+alist
+EOF
+ break;;
+ "") cat > "$expected" <<EOF
$testname
EOF
+ break;;
+ *) echo "Unknown response to whatnow readline test"
+ echo "Response is: ${whatnowtest}"
+ exit 1
+ break;;
+esac
# whatnow's exit status is always 1 so that is not a failure
set +e
echo "attach $testname_quoted" | \
- whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
-echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
+ TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
+echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \
+ 2>> $actualerr >> $actual
echo "detach $testname_quoted" | \
- whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
-echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
+ TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
+echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \
+ 2>> $actualerr >> $actual
set -e
check "$expectederr" "$actualerr"
diff --git a/test/whatnow/test-cd b/test/whatnow/test-cd
index 1ff5d96..f7f7bc9 100755
--- a/test/whatnow/test-cd
+++ b/test/whatnow/test-cd
@@ -27,9 +27,30 @@ actualerr=$MH_TEST_DIR/$$.actualerr
expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/$$.actual
-cat > $expected <<EOF
+#
+# Handle different output depending on readline version
+#
+
+set +e
+whatnowtest="$(echo cd | TERM=dumb whatnow -prompt '')"
+set -e
+
+case "${whatnowtest}" in
+ cd) cat > "$expected" <<EOF
+cd ${MH_TEST_DIR}/foo\'s\ bar
+pwd
+$SPDIR
+EOF
+ break;;
+ "") cat > "$expected" <<EOF
$SPDIR
EOF
+ break;;
+ *) echo "Unknown response to whatnow readline test"
+ echo "Response is: ${whatnowtest}"
+ exit 1
+ break;;
+esac
cat > $expectederr <<EOF
EOF
@@ -37,7 +58,7 @@ EOF
# ||true to ignore whatnow's exit status
# watch the quoting -- shell and printf and then the shell run inside whatnow
printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | \
- whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true
+ TERM=dumb whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true
check "$expectederr" "$actualerr"
check "$expected" "$actual"
diff --git a/test/whatnow/test-ls b/test/whatnow/test-ls
index c289830..9d072fa 100755
--- a/test/whatnow/test-ls
+++ b/test/whatnow/test-ls
@@ -28,16 +28,38 @@ actualerr=$MH_TEST_DIR/$$.actualerr
expected=$MH_TEST_DIR/$$.expected
actual=$MH_TEST_DIR/$$.actual
-cat > $expected <<EOF
+#
+# Handle different output depending on readline version
+#
+
+set +e
+whatnowtest="$(echo cd | TERM=dumb whatnow -prompt '')"
+set -e
+
+case "${whatnowtest}" in
+ cd) cat > "$expected" <<EOF
+baz
+boz
+ls
+EOF
+ break;;
+ "") cat > "$expected" <<EOF
baz
boz
EOF
+ break;;
+ *) echo "Unknown response to whatnow readline test"
+ echo "Response is: ${whatnowtest}"
+ exit 1
+ break;;
+esac
cat > $expectederr <<EOF
EOF
# NB use of sort as the order of output of ls is not guaranteed
-echo 'ls' | whatnow -noedit -prompt '' 2> "$actualerr" | sort > "$actual"
+echo 'ls' | TERM=dumb whatnow -noedit -prompt '' 2> "$actualerr" | \
+ sort > "$actual"
check "$expectederr" "$actualerr"
check "$expected" "$actual"
-----------------------------------------------------------------------
Summary of changes:
test/whatnow/test-attach-detach | 36 +++++++++++++++++++++++++++++++-----
test/whatnow/test-cd | 25 +++++++++++++++++++++++--
test/whatnow/test-ls | 26 ++++++++++++++++++++++++--
3 files changed, 78 insertions(+), 9 deletions(-)
hooks/post-receive
--
The nmh Mail Handling System
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Nmh-commits] [SCM] The nmh Mail Handling System branch, master, updated. 87e2eacc63f1ecc60d58a01921cdcf8b1aa55171,
Ken Hornstein <=