1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

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
This commit is contained in:
Barton E. Schaefer 2014-03-18 09:57:47 -07:00
parent 848065a5a2
commit da57ddb7c8
3 changed files with 21 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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.$$