about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-11-17 16:19:12 +0100
committerOliver Kiddle <opk@zsh.org>2014-11-17 16:29:10 +0100
commitc95c2ac838e04e507f8e4d9bd0ed4d966306a9b9 (patch)
treeba667cf81a36094518153e34b0ef854cfc457b0c /Test
parent25cc978a99aae07604f4c84dd2e82d3669c2c61c (diff)
downloadzsh-c95c2ac838e04e507f8e4d9bd0ed4d966306a9b9.tar.gz
zsh-c95c2ac838e04e507f8e4d9bd0ed4d966306a9b9.tar.xz
zsh-c95c2ac838e04e507f8e4d9bd0ed4d966306a9b9.zip
33699: support short delays in zle tests where we
need KEYTIMEOUT to elapse
Diffstat (limited to 'Test')
-rw-r--r--Test/X02zlevi.ztst6
-rw-r--r--Test/comptest12
2 files changed, 15 insertions, 3 deletions
diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index 4210a72cc..297fb9aee 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -37,6 +37,12 @@
 >3
 >CURSOR: 5
 
+  zletest $'\e' $'~aI\e' $'~o\e' \~
+0:swap case on a blank line
+>BUFFER: i
+>
+>CURSOR: 2
+
   zletest $' four\eO\C-v\tthree\eO  two\eOone\e3J'
 0:join lines with line count
 >BUFFER: one two three
diff --git a/Test/comptest b/Test/comptest
index 96072fdcc..654c0f168 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -36,6 +36,7 @@ comptestinit () {
 'LISTMAX=10000000
 stty 38400 columns 80 rows 24 werase undef
 TERM=vt100
+KEYTIMEOUT=1
 setopt zle
 autoload -U compinit
 compinit -u
@@ -159,9 +160,14 @@ comptest () {
 }
 
 zletest () {
-  input="$*"
-  # zpty_flush Before zletest
-  zpty -n -w zsh "$input"$'\C-X'
+  local first=0
+  for input; do
+    # sleep for $KEYTIMEOUT
+    (( first++ )) && read -t 0.011 -k 1 < /dev/null
+    # zpty_flush Before zletest
+    zpty -n -w zsh "$input"
+  done
+  zpty -n -w zsh $'\C-X'
   zpty -r -m zsh log "*<WIDGET><finish>*<PROMPT>*" || {
     print "failed to invoke finish widget."
     return 1