mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-09 18:38:05 +02:00
15329: test script changes to go with 15327 LINENO change
This commit is contained in:
parent
7457bdc19d
commit
cef000cc62
11 changed files with 66 additions and 60 deletions
|
@ -1,5 +1,12 @@
|
||||||
2001-07-09 Peter Stephenson <pws@csr.com>
|
2001-07-09 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 15329: Test/A01grammar.ztst, Test/A02alias.ztst,
|
||||||
|
Test/A04redirect.ztst, Test/A05execution.ztst, Test/C01arith.ztst,
|
||||||
|
Test/D04parameter.ztst, Test/D06subscript.ztst,
|
||||||
|
Test/E01options.ztst, Test/E02xtrace.ztst, Test/V01zmodload.ztst:
|
||||||
|
changes in test scripts required by 15327; mostly benign but
|
||||||
|
the behaviour of LINENO in trap '...' DEBUG is probably wrong.
|
||||||
|
|
||||||
* 15327: Src/builtin.c, Src/exec.c, Src/glob.c, Src/parse.c,
|
* 15327: Src/builtin.c, Src/exec.c, Src/glob.c, Src/parse.c,
|
||||||
Src/Modules/parameter.c, Src/Modules/zpty.c, Src/Modules/zutil.c:
|
Src/Modules/parameter.c, Src/Modules/zpty.c, Src/Modules/zutil.c:
|
||||||
Always use local LINENOs in parse_string(). Currently we only
|
Always use local LINENOs in parse_string(). Currently we only
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
:
|
:
|
||||||
fi
|
fi
|
||||||
1d:`if ...' (iv)
|
1d:`if ...' (iv)
|
||||||
?ZTST_execchunk:-1: parse error near `fi'
|
?ZTST_execchunk:3: parse error near `fi'
|
||||||
|
|
||||||
for name in word to term; do
|
for name in word to term; do
|
||||||
print $name
|
print $name
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
\foo foo
|
\foo foo
|
||||||
127:Not aliasing
|
127:Not aliasing
|
||||||
?ZTST_execchunk:2: command not found: foo
|
?ZTST_execchunk:1: command not found: foo
|
||||||
|
|
||||||
\bar \bar
|
\bar \bar
|
||||||
0:Aliasing with a backslash
|
0:Aliasing with a backslash
|
||||||
|
|
|
@ -200,7 +200,7 @@
|
||||||
print cat input >out1
|
print cat input >out1
|
||||||
<out1
|
<out1
|
||||||
1:READNULLCMD with NULLCMD unset
|
1:READNULLCMD with NULLCMD unset
|
||||||
?ZTST_execchunk:2: redirection with no command
|
?ZTST_execchunk:3: redirection with no command
|
||||||
|
|
||||||
NULLCMD=:
|
NULLCMD=:
|
||||||
>out1
|
>out1
|
||||||
|
|
|
@ -134,7 +134,7 @@
|
||||||
rm fn
|
rm fn
|
||||||
0:trap DEBUG
|
0:trap DEBUG
|
||||||
>Line 1
|
>Line 1
|
||||||
>Line 2
|
>Line 1
|
||||||
|
|
||||||
TRAPZERR() { print Command failed; }
|
TRAPZERR() { print Command failed; }
|
||||||
true
|
true
|
||||||
|
|
|
@ -53,11 +53,11 @@
|
||||||
|
|
||||||
print $(( 3 ? 2 ))
|
print $(( 3 ? 2 ))
|
||||||
1:parsing ternary (1)
|
1:parsing ternary (1)
|
||||||
?ZTST_execchunk:2: ':' expected
|
?ZTST_execchunk:1: ':' expected
|
||||||
|
|
||||||
print $(( 3 ? 2 : 1 : 4 ))
|
print $(( 3 ? 2 : 1 : 4 ))
|
||||||
1:parsing ternary (2)
|
1:parsing ternary (2)
|
||||||
?ZTST_execchunk:2: ':' without '?'
|
?ZTST_execchunk:1: ':' without '?'
|
||||||
|
|
||||||
print $(( 0, 4 ? 3 : 1, 5 ))
|
print $(( 0, 4 ? 3 : 1, 5 ))
|
||||||
0:comma operator
|
0:comma operator
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
print $(( 13 = 42 ))
|
print $(( 13 = 42 ))
|
||||||
1:bad lvalue
|
1:bad lvalue
|
||||||
?ZTST_execchunk:2: lvalue required
|
?ZTST_execchunk:1: lvalue required
|
||||||
|
|
||||||
x=/bar
|
x=/bar
|
||||||
(( x = 32 ))
|
(( x = 32 ))
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
1:${...:?...}, ${...?...}
|
1:${...:?...}, ${...?...}
|
||||||
>set1v
|
>set1v
|
||||||
>
|
>
|
||||||
?ZTST_execchunk:2: unset1: exiting1
|
?ZTST_execchunk:1: unset1: exiting1
|
||||||
?ZTST_execchunk:2: null1: exiting2
|
?ZTST_execchunk:2: null1: exiting2
|
||||||
|
|
||||||
print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}
|
print ${set1:+word1} ${set1+word2} ${null1:+word3} ${null1+word4}
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
|
|
||||||
eval 'A[*]=star'
|
eval 'A[*]=star'
|
||||||
1:Illegal associative array assignment
|
1:Illegal associative array assignment
|
||||||
?ZTST_execchunk:2: A: attempt to set slice of associative array
|
?ZTST_execchunk:1: A: attempt to set slice of associative array
|
||||||
|
|
||||||
x='*'
|
x='*'
|
||||||
A[$x]=xstar
|
A[$x]=xstar
|
||||||
|
|
|
@ -133,7 +133,7 @@
|
||||||
print [b
|
print [b
|
||||||
1:BAD_PATTERN option
|
1:BAD_PATTERN option
|
||||||
>[a
|
>[a
|
||||||
?ZTST_execchunk:2: bad pattern: [b
|
?ZTST_execchunk:4: bad pattern: [b
|
||||||
|
|
||||||
unsetopt bareglobqual nomatch
|
unsetopt bareglobqual nomatch
|
||||||
print *(.)
|
print *(.)
|
||||||
|
@ -192,8 +192,8 @@
|
||||||
1q:CDABLE_VARS option
|
1q:CDABLE_VARS option
|
||||||
>`print -P '%~'`/tmpcd
|
>`print -P '%~'`/tmpcd
|
||||||
>back in options.tmp
|
>back in options.tmp
|
||||||
?ZTST_execchunk:cd:2: no such file or directory: cdablevar1
|
?ZTST_execchunk:cd:4: no such file or directory: cdablevar1
|
||||||
?ZTST_execchunk:cd:2: no such file or directory: cdablevar2
|
?ZTST_execchunk:cd:10: no such file or directory: cdablevar2
|
||||||
|
|
||||||
# CHASE_DOTS should go with CHASE_LINKS in B01cd.ztst
|
# CHASE_DOTS should go with CHASE_LINKS in B01cd.ztst
|
||||||
# which saves me having to write it here.
|
# which saves me having to write it here.
|
||||||
|
@ -227,8 +227,8 @@
|
||||||
>wimpole
|
>wimpole
|
||||||
>royston
|
>royston
|
||||||
>foxton
|
>foxton
|
||||||
?ZTST_execchunk:2: file exists: foo1
|
?ZTST_execchunk:4: file exists: foo1
|
||||||
?ZTST_execchunk:2: no such file or directory: bar1
|
?ZTST_execchunk:6: no such file or directory: bar1
|
||||||
|
|
||||||
setopt cshjunkieloops
|
setopt cshjunkieloops
|
||||||
eval 'for f in swaffham bulbeck; print $f; end'
|
eval 'for f in swaffham bulbeck; print $f; end'
|
||||||
|
@ -239,7 +239,7 @@
|
||||||
>swaffham
|
>swaffham
|
||||||
>bulbeck
|
>bulbeck
|
||||||
?next one should fail
|
?next one should fail
|
||||||
?ZTST_execchunk:-1: parse error near `end'
|
?ZTST_execchunk:1: parse error near `end'
|
||||||
|
|
||||||
setopt cshjunkiequotes
|
setopt cshjunkiequotes
|
||||||
print this should cause an error >&2
|
print this should cause an error >&2
|
||||||
|
@ -253,7 +253,7 @@
|
||||||
>line three
|
>line three
|
||||||
> line four
|
> line four
|
||||||
?this should cause an error
|
?this should cause an error
|
||||||
?ZTST_execchunk:-1: unmatched '
|
?ZTST_execchunk:1: unmatched '
|
||||||
?this should not
|
?this should not
|
||||||
|
|
||||||
nullcmd() { print '$NULLCMD run'; }
|
nullcmd() { print '$NULLCMD run'; }
|
||||||
|
@ -279,10 +279,10 @@
|
||||||
>Running $READNULLCMD
|
>Running $READNULLCMD
|
||||||
>$NULLCMD run
|
>$NULLCMD run
|
||||||
?This should fail
|
?This should fail
|
||||||
?ZTST_execchunk:2: redirection with no command
|
?ZTST_execchunk:8: redirection with no command
|
||||||
?This should succeed
|
?This should succeed
|
||||||
?This should also fail
|
?This should also fail
|
||||||
?ZTST_execchunk:2: redirection with no command
|
?ZTST_execchunk:13: redirection with no command
|
||||||
|
|
||||||
# nomatch should be overridden by cshnullglob
|
# nomatch should be overridden by cshnullglob
|
||||||
setopt nomatch cshnullglob
|
setopt nomatch cshnullglob
|
||||||
|
@ -297,7 +297,7 @@
|
||||||
>tmpcd tmpfile1 tmpfile2 blah
|
>tmpcd tmpfile1 tmpfile2 blah
|
||||||
>tmpcd tmpfile1 tmpfile2 nothing* blah
|
>tmpcd tmpfile1 tmpfile2 nothing* blah
|
||||||
>nothing* blah
|
>nothing* blah
|
||||||
?hoping for no match: ZTST_execchunk:2: no match
|
?hoping for no match: ZTST_execchunk:4: no match
|
||||||
?
|
?
|
||||||
|
|
||||||
# The trick is to avoid =cat being expanded in the output while $catpath is.
|
# The trick is to avoid =cat being expanded in the output while $catpath is.
|
||||||
|
@ -625,7 +625,7 @@
|
||||||
print with nomatch flooble*
|
print with nomatch flooble*
|
||||||
1:NOMATCH option
|
1:NOMATCH option
|
||||||
>with nonomatch: flooble*
|
>with nonomatch: flooble*
|
||||||
?ZTST_execchunk:2: no matches found: flooble*
|
?ZTST_execchunk:4: no matches found: flooble*
|
||||||
|
|
||||||
# NULL_GLOB should override NONOMATCH...
|
# NULL_GLOB should override NONOMATCH...
|
||||||
setopt nullglob nomatch
|
setopt nullglob nomatch
|
||||||
|
@ -688,7 +688,7 @@
|
||||||
>File in upper dir
|
>File in upper dir
|
||||||
>File in lower dir
|
>File in lower dir
|
||||||
>unsetting option...
|
>unsetting option...
|
||||||
?ZTST_execchunk:2: no such file or directory: pathtestdir/findme
|
?ZTST_execchunk:14: no such file or directory: pathtestdir/findme
|
||||||
|
|
||||||
setopt posixbuiltins
|
setopt posixbuiltins
|
||||||
command print foo
|
command print foo
|
||||||
|
@ -698,7 +698,7 @@
|
||||||
127:POSIX_BUILTINS option
|
127:POSIX_BUILTINS option
|
||||||
>foo
|
>foo
|
||||||
>unsetting...
|
>unsetting...
|
||||||
?ZTST_execchunk:2: command not found: print
|
?ZTST_execchunk:5: command not found: print
|
||||||
|
|
||||||
# This option seems to be problematic. I don't quite know how it works.
|
# This option seems to be problematic. I don't quite know how it works.
|
||||||
## func() {
|
## func() {
|
||||||
|
@ -807,7 +807,7 @@
|
||||||
>one'quoted'expression
|
>one'quoted'expression
|
||||||
>anotherquotedexpression
|
>anotherquotedexpression
|
||||||
|
|
||||||
# too lazy to test jobs -Z and ARGV0.
|
# too lazy to test jobs -Z and ARGV0.
|
||||||
(setopt restricted; cd /)
|
(setopt restricted; cd /)
|
||||||
(setopt restricted; PATH=/bin:/usr/bin)
|
(setopt restricted; PATH=/bin:/usr/bin)
|
||||||
(setopt restricted; /bin/ls)
|
(setopt restricted; /bin/ls)
|
||||||
|
@ -817,13 +817,13 @@
|
||||||
(setopt restricted; unsetopt restricted)
|
(setopt restricted; unsetopt restricted)
|
||||||
:
|
:
|
||||||
0:RESTRICTED option
|
0:RESTRICTED option
|
||||||
?ZTST_execchunk:cd:2: restricted
|
?ZTST_execchunk:cd:1: restricted
|
||||||
?ZTST_execchunk:2: PATH: restricted
|
?ZTST_execchunk:2: PATH: restricted
|
||||||
?ZTST_execchunk:2: /bin/ls: restricted
|
?ZTST_execchunk:3: /bin/ls: restricted
|
||||||
?ZTST_execchunk:hash:2: restricted: /bin/ls
|
?ZTST_execchunk:hash:4: restricted: /bin/ls
|
||||||
?ZTST_execchunk:2: writing redirection not allowed in restricted mode
|
?ZTST_execchunk:5: writing redirection not allowed in restricted mode
|
||||||
?ZTST_execchunk:exec:2: ls: restricted
|
?ZTST_execchunk:exec:6: ls: restricted
|
||||||
?ZTST_execchunk:unsetopt:2: can't change option: restricted
|
?ZTST_execchunk:unsetopt:7: can't change option: restricted
|
||||||
|
|
||||||
fn() {
|
fn() {
|
||||||
print =ls ={ls,}
|
print =ls ={ls,}
|
||||||
|
@ -909,10 +909,9 @@
|
||||||
>nonsense
|
>nonsense
|
||||||
>nonsense
|
>nonsense
|
||||||
>nonsense
|
>nonsense
|
||||||
?fn:-1: parse error near `print'
|
?fn:1: parse error near `print'
|
||||||
?fn:-1: parse error near `print'
|
?fn:1: parse error near `print'
|
||||||
?fn:-1: parse error near `print'
|
?fn:1: parse error near `print'
|
||||||
# Eugh, that line numbering behaviour with eval is probably a bug.
|
|
||||||
|
|
||||||
fn() { print -l $*; }
|
fn() { print -l $*; }
|
||||||
setopt shwordsplit
|
setopt shwordsplit
|
||||||
|
@ -959,6 +958,6 @@
|
||||||
0:XTRACE option
|
0:XTRACE option
|
||||||
>message
|
>message
|
||||||
>message
|
>message
|
||||||
?+ZTST_execchunk:2> fn
|
?+ZTST_execchunk:3> fn
|
||||||
?+fn:0> print message
|
?+fn:0> print message
|
||||||
?+ZTST_execchunk:2> unsetopt xtrace
|
?+ZTST_execchunk:4> unsetopt xtrace
|
||||||
|
|
|
@ -54,30 +54,30 @@
|
||||||
>Tracing: function 2>file
|
>Tracing: function 2>file
|
||||||
>Tracing: source
|
>Tracing: source
|
||||||
>Tracing: source 2>file
|
>Tracing: source 2>file
|
||||||
>+ZTST_execchunk:2> print Tracing: ( builtin ) 2>file
|
>+ZTST_execchunk:7> print Tracing: ( builtin ) 2>file
|
||||||
>+ZTST_execchunk:2> cat
|
>+ZTST_execchunk:9> cat
|
||||||
>+ZTST_execchunk:2> print Tracing: { builtin } 2>file
|
>+ZTST_execchunk:11> print Tracing: { builtin } 2>file
|
||||||
>+ZTST_execchunk:2> cat
|
>+ZTST_execchunk:13> cat
|
||||||
>+ZTST_execchunk:2> print Tracing: do builtin done 2>file
|
>+ZTST_execchunk:15> print Tracing: do builtin done 2>file
|
||||||
>+ZTST_execchunk:2> cat
|
>+ZTST_execchunk:17> cat
|
||||||
?+ZTST_execchunk:2> print Tracing: builtin
|
?+ZTST_execchunk:2> print Tracing: builtin
|
||||||
?+ZTST_execchunk:2> print Tracing: builtin 2>file
|
?+ZTST_execchunk:3> print Tracing: builtin 2>file
|
||||||
?+ZTST_execchunk:2> cat
|
?+ZTST_execchunk:4> cat
|
||||||
?+ZTST_execchunk:2> cat
|
?+ZTST_execchunk:5> cat
|
||||||
?+ZTST_execchunk:2> print Tracing: ( builtin )
|
?+ZTST_execchunk:6> print Tracing: ( builtin )
|
||||||
?+ZTST_execchunk:2> cat
|
?+ZTST_execchunk:8> cat
|
||||||
?+ZTST_execchunk:2> print Tracing: { builtin }
|
?+ZTST_execchunk:10> print Tracing: { builtin }
|
||||||
?+ZTST_execchunk:2> cat
|
?+ZTST_execchunk:12> cat
|
||||||
?+ZTST_execchunk:2> print Tracing: do builtin done
|
?+ZTST_execchunk:14> print Tracing: do builtin done
|
||||||
?+ZTST_execchunk:2> cat
|
?+ZTST_execchunk:16> cat
|
||||||
?+ZTST_execchunk:2> xtf Tracing: function
|
?+ZTST_execchunk:18> xtf Tracing: function
|
||||||
?+xtf:0> local regression_test_dummy_variable
|
?+xtf:1> local regression_test_dummy_variable
|
||||||
?+xtf:0> print Tracing: function
|
?+xtf:2> print Tracing: function
|
||||||
?+ZTST_execchunk:2> xtf Tracing: function 2>file
|
?+ZTST_execchunk:19> xtf Tracing: function 2>file
|
||||||
?+xtf:0> local regression_test_dummy_variable
|
?+xtf:1> local regression_test_dummy_variable
|
||||||
?+xtf:0> print Tracing: function 2>file
|
?+xtf:2> print Tracing: function 2>file
|
||||||
?+ZTST_execchunk:2> . ./xt.in Tracing: source
|
?+ZTST_execchunk:20> . ./xt.in Tracing: source
|
||||||
?+./xt.in:1> print Tracing: source
|
?+./xt.in:1> print Tracing: source
|
||||||
?+ZTST_execchunk:2> . ./xt.in Tracing: source 2>file
|
?+ZTST_execchunk:21> . ./xt.in Tracing: source 2>file
|
||||||
?+./xt.in:1> print Tracing: source 2>file
|
?+./xt.in:1> print Tracing: source 2>file
|
||||||
?+ZTST_execchunk:2> set +x
|
?+ZTST_execchunk:22> set +x
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
zmodload zsh/main
|
zmodload zsh/main
|
||||||
1:Test reloading an already-loaded module
|
1:Test reloading an already-loaded module
|
||||||
?ZTST_execchunk:zmodload:2: module zsh/main already loaded.
|
?ZTST_execchunk:zmodload:1: module zsh/main already loaded.
|
||||||
|
|
||||||
# Loop over the modules found above and attempt to load each one. Use
|
# Loop over the modules found above and attempt to load each one. Use
|
||||||
# the -i flag in case dependencies cause multiple modules to be loaded,
|
# the -i flag in case dependencies cause multiple modules to be loaded,
|
||||||
|
|
Loading…
Reference in a new issue