1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

tests/pty.sh: misc tweaks

src/cmd/ksh93/tests/pty.sh:
- Fix race condition in the test "raw Bourne mode literal tab
  characters with wide characters enabled" by adding 'd 10' to add
  a 10-millisecond delay before every write. Thanks to @JohnoKing:
  https://github.com/ksh93/ksh/pull/57#issuecomment-653617531
- Fix locale for test "raw Bourne mode backslash handling" (should
  be UTF-8, not UTF8) (re: a0dcdeea).
- Add a few more dummy # err_exit # comments to allow shtests to
  count the number of tests.
This commit is contained in:
Martijn Dekker 2020-07-03 21:52:28 +02:00
parent a0dcdeeade
commit fa70fc3f77

View file

@ -453,7 +453,6 @@ w fg
u yes-yes u yes-yes
! !
# ======
# err_exit # # err_exit #
# Test file name completion in vi mode # Test file name completion in vi mode
mkdir /tmp/fakehome mkdir /tmp/fakehome
@ -477,6 +476,8 @@ L raw Bourne mode literal tab characters with wide characters disabled
# This gets handled by ed_read() in edit.c; it does not expand tab # This gets handled by ed_read() in edit.c; it does not expand tab
# characters on the command line. # characters on the command line.
d 10
p :test-1:
w set +o vi +o emacs w set +o vi +o emacs
p :test-2: p :test-2:
w true /de\tv/nu\tl\tl w true /de\tv/nu\tl\tl
@ -491,21 +492,17 @@ L raw Bourne mode literal tab characters with wide characters enabled
# This gets handled by ed_viread() in vi.c (even though vi mode is off); # This gets handled by ed_viread() in vi.c (even though vi mode is off);
# it expands tab characters to spaces on the command line. # it expands tab characters to spaces on the command line.
d 10
p :test-1:
w set +o vi +o emacs w set +o vi +o emacs
p :test-2: p :test-2:
w true /de\tv/nu\tl\tl w true /de\tv/nu\tl\tl
r ^:test-2: true /de v/nu l l\r\n$
# TODO: there is some race condition in either pty or in ksh's default edit
# mode, which causes it to expect/generate either tabs ('\t') or expanded
# spaces, randomly, intermittently. This is functionally equivalent as it
# only affects either pty or (invisibly) the editing command line, so not a
# high priority. Until this is tracked down and fixed, accept both.
r ^:test-2: true (/de\tv/nu\tl\tl|/de v/nu l l)\r\n$
p :test-3: p :test-3:
! !
LC_ALL=C.UTF8 tst $LINENO <<"!" # err_exit #
LC_ALL=C.UTF-8 tst $LINENO <<"!"
L raw Bourne mode backslash handling L raw Bourne mode backslash handling
# The escaping backslash feature should be disabled in the raw Bourne mode. # The escaping backslash feature should be disabled in the raw Bourne mode.
@ -522,6 +519,8 @@ w true incorrect\\\cXtrue correct
r ^:test-3: true correct\r\n$ r ^:test-3: true correct\r\n$
! !
# err_exit #
# err_exit #
for mode in emacs vi; do for mode in emacs vi; do
tst $LINENO << ! tst $LINENO << !
L escaping backslashes in $mode mode L escaping backslashes in $mode mode