42 Commits

Author SHA1 Message Date
Marlon Richert
6c993144bd 51860: simplify suffix handling in _prefix to remove less accurate hack
This solves the following problems in the _prefix completer:
- The old code had logic for dealing with compstate[unambiguous] that
  was unnecessary. It works fine without it.
- Because of this logic, if a widget set compstate[insert]=1 after
  calling _main_complete, an `x` was left after the completion on the
  command line.
- If the same widget also set `compstate[to_end]=`, then instead, the
  last character of the inserted completion would be treated as an
  autoremovable suffix, with the actual suffix being inserted to the
  line as a normal character.
- After inserting a completion, the cursor would move to the end of the
  entire current word on the command, not the end of word that was
  inserted. This is not what you want with _prefix, since you are trying
  to complete a word _before_ the one on the command line, after which
  you usually want to insert a separator, such as a space or slash,
  before the next word.
2023-06-22 13:13:09 -07:00
Marlon Richert
aaf619cc22 48413: Fix _expand completion test 2021-04-06 13:59:43 +02:00
Bart Schaefer
126a3158d5 46189: Ignore exit status of final zpty_flush in comptesteval 2020-07-07 09:36:11 -07:00
Daniel Shahaf
805b946b53 46174/0002: test harness: Restore indentation after the previous commit. No functional change. 2020-07-05 11:11:22 +00:00
Daniel Shahaf
63fde0b744 46174/0001: test harness: Plug a symlink attack
The test harness created tempfiles with a predictable names and sourced
them without verifying they had been created by itself.  This opened
anyone who ran the test suite to a symlink attacks from other local
users on the build machine.

Fix this by creating the file whilst NO_CLOBBER and ERR_EXIT are both in
scope, to ensure that we'll abort unless the file really was created as
expected.

Put the existing rm(1) call in a try/always block to help it be unlinked
on test failures, thus reducing the chances of the NO_CLOBBER check
triggering on tempfiles created by earlier test suite runs.

I had first tried to fix this by using the
.
    () { ... } =(:)
.
idiom, but couldn't get that to work: it broke the %prep code of X03
with ZTST_verbose unset (its default value) but not with ZTST_verbose=3.
(I tried to set the latter to debug zpty_flush.)

While there, add a needed-in-principle-but-noop-in-this-specific-case (q).

Indentation will be restored in the next commit.
2020-07-05 11:11:22 +00:00
Peter Stephenson
a5233fd01e 37378: New bindkey tests.
Also fix Meta bug on pattern match in zpty -r.
2015-12-10 17:51:41 +00:00
Barton E. Schaefer
b1688305cc 37181: consistent use of zmodload and corresponding ZTST_unimplemented or ZTST_skip 2015-11-21 23:56:25 -08:00
Barton E. Schaefer
158484941a 34774: fix %prep and use read from a no-op pipe to force wait for the timeout 2015-03-25 09:57:23 -07:00
Barton E. Schaefer
13bad92fd8 34772: add new test suite file for history; fix "read" usage in comptest 2015-03-23 21:18:58 -07:00
Jun-ichi Takimoto
0da4b11add 33829: unbind ESC~ as a more reliable workaround 2014-12-07 16:31:48 +09:00
Jun T
c4110f7f4e 33769: workaround for KEYTIMEOUT to work from test
cases on Darwin and FreeBSD
2014-11-25 22:49:14 +01:00
Oliver Kiddle
d29e02c1a3 33704: keybindings, documentation, tests and minor
fixes for vim style visual selection changes
2014-11-17 23:01:00 +01:00
Oliver Kiddle
c95c2ac838 33699: support short delays in zle tests where we
need KEYTIMEOUT to elapse
2014-11-17 16:29:10 +01:00
Oliver Kiddle
f26abf3a17 33695: fix various vi-indent problems and vi-swap-case on a blank line 2014-11-15 21:27:44 +01:00
Jun T
c9804bebd8 33599: workaround zpty issue that causes vi test
cases to fail on MacOS and FreeBSD
2014-11-09 22:06:52 +01:00
Barton E. Schaefer
da57ddb7c8 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
2014-03-18 09:57:47 -07:00
Barton E. Schaefer
ae0b56cdda 32389 (with Jun Takimoto): additional PTY and keybinding adjustments 2014-02-15 13:45:35 -08:00
Barton E. Schaefer
7274ea8c49 Fix character transposition typo 2014-02-13 08:25:09 -08:00
Barton E. Schaefer
5c89c4ca9c 32377: change keybindings and PTY control for vi-mode tests to make them more reliable 2014-02-13 08:23:32 -08:00
Oliver Kiddle
137b15a447 32355: document and test vi mode undo changes 2014-02-05 23:18:26 +01:00
Barton E. Schaefer
083328e697 unposted: move path assignment from comptest to Y01completion.ztst 2013-12-26 16:04:30 -08:00
Barton E. Schaefer
d83faa9d99 32183: regression tests for 32182 and 31611 2013-12-25 16:27:04 -08:00
J. Takimoto
b9da4efea7 32137: set pseudo-terminal speed to prevent padding characters 2013-12-16 22:18:01 -08:00
Oliver Kiddle
b6544d1ef3 31041: add support for testing line editor widgets from the test suite 2013-02-12 10:55:32 +00:00
Peter Stephenson
e7c9e03c58 26301: make zpty -r exit more cleanly on bad reads
add option -m to make zpty -r return status 1 if pattern failed to match
use this option in comptest
2009-01-13 12:09:26 +00:00
Peter Stephenson
51b6ff2723 unposted, c.f. 25848: attempt to sanitize comptest environment 2008-10-12 19:20:00 +00:00
Bart Schaefer
50f88338e6 Assorted "make check" tweaks. 2001-06-25 03:06:33 +00:00
Bart Schaefer
02a3c7292b Avoid echotc in completion tests. 2001-06-09 17:25:56 +00:00
Bart Schaefer
956fd2a76c Fix "make check" in emacs shell mode. 2001-06-08 03:02:46 +00:00
Peter Stephenson
8ff0785863 Fixes from Andrej for zpty on cygwin 2001-05-08 10:26:58 +00:00
Sven Wischnowsky
6150ef8696 (13892) fixes for fpaths and completion matching 2001-04-03 11:25:11 +00:00
Bart Schaefer
db3d3e2b27 13442: Use +Z to suppress loading of ZLE modules when testing. 2001-02-08 03:29:58 +00:00
Felix Rosencrantz
5c111766c1 zsh-workers/13395: Added code to test compstate[insert_positions], value of insert_positions are now reported 2001-01-28 19:37:30 +00:00
Sven Wischnowsky
16d7e31ae8 make non-blocking IO on ptys work again; add -t option to test if command is still alive (13035) 2000-10-19 08:46:54 +00:00
Bart Schaefer
715278d063 12151: Fix ZDOTDIR during "make check" for static builds. 2000-07-04 00:45:07 +00:00
Bart Schaefer
122e46b406 Fix comptest interaction with compinit. 2000-06-22 17:33:38 +00:00
Sven Wischnowsky
0301303666 update comptest to not set ZLS_COLORS directly (11982) 2000-06-19 12:16:34 +00:00
Oliver Kiddle
4e9967dcca fix wording in error messages for tests (11755) 2000-06-05 23:06:52 +00:00
Bart Schaefer
3ce575b0f9 Felix Rosencrantz: 11450: Replace tr with paramsubst. 2000-05-18 03:33:39 +00:00
Tanaka Akira
20a527fcaa 11441: Test/comptest, Test/53completion.ztst,
Test/54compmatch.ztst: use only one zsh process to test for each
completion test file.
2000-05-17 12:31:32 +00:00
Sven Wischnowsky
05d3c175a5 add Felix' completion matching test; some fixes for bugs shown by it (11439) 2000-05-17 11:59:32 +00:00
Tanaka Akira
6513a23fbe Initial revision 2000-02-29 15:51:21 +00:00