about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Test/X05zleincarg.ztst40
2 files changed, 23 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 262a34239..a155f7b1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2024-09-14  Oliver Kiddle  <opk@zsh.org>
 
+	* 53087: Test/X05zleincarg.ztst: don't produce spurious error
+	when zpty is missing
+
 	* 53086: configure.ac: change flags used for building dynamic
 	modules on Haiku OS
 
diff --git a/Test/X05zleincarg.ztst b/Test/X05zleincarg.ztst
index cd9817c82..f712e9426 100644
--- a/Test/X05zleincarg.ztst
+++ b/Test/X05zleincarg.ztst
@@ -5,29 +5,29 @@
   if ( zmodload zsh/zpty 2>/dev/null ); then
     . $ZTST_srcdir/comptest
     comptestinit -v -z $ZTST_testdir/../Src/zsh
+    zpty_run '
+      autoload -Uz incarg
+      for name in {,vim-,vim-backward-}{,sync-}{inc,dec}arg; do
+        zle -N "$name" incarg
+      done
+      bindkey -v "^N" incarg
+      bindkey -v "^P" decarg
+      bindkey -v "^F" sync-incarg
+      bindkey -v "^B" sync-decarg
+      bindkey -a "^N" vim-incarg
+      bindkey -a "^P" vim-decarg
+      bindkey -a "^F" vim-sync-incarg
+      bindkey -a "^B" vim-sync-decarg
+      bindkey -a "^E" vim-backward-incarg
+      bindkey -a "^Y" vim-backward-decarg
+      unset TMUX_PANE ITERM_SESSION_ID
+      tmux() {
+        echo "$TMUX_PANE"
+      }
+    '
   else
     ZTST_unimplemented="the zsh/zpty module is not available"
   fi
-  zpty_run '
-    autoload -Uz incarg
-    for name in {,vim-,vim-backward-}{,sync-}{inc,dec}arg; do
-      zle -N "$name" incarg
-    done
-    bindkey -v "^N" incarg
-    bindkey -v "^P" decarg
-    bindkey -v "^F" sync-incarg
-    bindkey -v "^B" sync-decarg
-    bindkey -a "^N" vim-incarg
-    bindkey -a "^P" vim-decarg
-    bindkey -a "^F" vim-sync-incarg
-    bindkey -a "^B" vim-sync-decarg
-    bindkey -a "^E" vim-backward-incarg
-    bindkey -a "^Y" vim-backward-decarg
-    unset TMUX_PANE ITERM_SESSION_ID
-    tmux() {
-      echo "$TMUX_PANE"
-    }
-  '
 
 %test