about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-03-18 09:57:47 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2014-03-18 09:57:47 -0700
commitda57ddb7c8435c78a072c4d07672d6f68f2c6680 (patch)
tree9452181e384f6ace1a17c029f1f7890e855e9094
parent848065a5a2a383b20964ae03a6c368d19692f9c2 (diff)
downloadzsh-da57ddb7c8435c78a072c4d07672d6f68f2c6680.tar.gz
zsh-da57ddb7c8435c78a072c4d07672d6f68f2c6680.tar.xz
zsh-da57ddb7c8435c78a072c4d07672d6f68f2c6680.zip
32497: avoid using comptesteval in the middle of a series of tests
The change in control required for sourcing the command file can confuse
the simulated interactive input
-rw-r--r--ChangeLog7
-rw-r--r--Test/X02zlevi.ztst12
-rw-r--r--Test/comptest8
3 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 840c66d0e..6e994a2ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-03-18  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* Jun T: 32497: Test/X02zlevi.ztst, Test/comptest: avoid using
+	comptesteval in the middle of a series of tests; the change in
+	control required for sourcing the command file can confuse the
+	simulated interactive input
+
 2014-03-17  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* Jun T: 32494: Doc/zman.yo: Yodl hack to fix indentation
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 60f878e46..19188dfb7 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -21,19 +21,19 @@
 >text
 >CURSOR: 8
 
-  comptesteval 'print -z before'
+  zpty_run 'print -z before'
   zletest $'after\e.'
 0:repeat initial edit with non-blank starting line
 >BUFFER: beforeafterafter
 >CURSOR: 15
 
-  comptesteval 'setopt overstrike;print -z bung'
+  zpty_run 'setopt overstrike;print -z bung'
   zletest $'ing\e2|.'
 0:repeat initial edit with overstrike set
 >BUFFER: binging
 >CURSOR: 3
 
-  comptesteval 'bindkey "^_" undo'
+  zpty_run 'bindkey "^_" undo'
   zletest $'undoc\037e'
 0:use of undo in vi insert mode
 >BUFFER: undoe
@@ -49,19 +49,19 @@
 >BUFFER: z
 >CURSOR: 1
 
-  comptesteval 'bindkey -a "^K" redo'
+  zpty_run 'bindkey -a "^K" redo'
   zletest $'123\C-_\e\C-k'
 0:undo in insert mode, redo in command
 >BUFFER: 123
 >CURSOR: 2
 
-  comptesteval 'bindkey "^Y" redo'
+  zpty_run 'bindkey "^Y" redo'
   zletest $'pre\eA123\C-_\C-y\eu'
 0:undo and redo in insert mode, undo in command
 >BUFFER: pre
 >CURSOR: 2
 
-  comptesteval 'bindkey "^Gu" split-undo'
+  zpty_run 'bindkey "^Gu" split-undo'
   zletest $'one\C-gutwo\eu'
 0:split the undo sequence
 >BUFFER: one
diff --git a/Test/comptest b/Test/comptest
index 48b6cdfea..4655f3b2b 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -102,6 +102,14 @@ zpty_flush() {
   fi
 }
 
+zpty_run() {
+  zpty -w zsh "$*"
+  zpty -r -m zsh log "*<PROMPT>*" || {
+    print "prompt hasn't appeared."
+    return 1
+  }
+}
+
 comptesteval () {
   local tmp=/tmp/comptest.$$