mirror of
https://github.com/zsh-users/zsh
synced 2024-09-15 22:20:22 +00:00
35369: better GLOB_ASSIGN testing
This commit is contained in:
parent
4dc4e23376
commit
897ad46692
|
@ -1,3 +1,8 @@
|
||||||
|
2015-06-02 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* 35369: Test/A06assign.ztst, Test/E01options.ztst: better
|
||||||
|
GLOB_ASSIGN testing.
|
||||||
|
|
||||||
2015-06-02 Mikael Magnusson <mikachu@gmail.com>
|
2015-06-02 Mikael Magnusson <mikachu@gmail.com>
|
||||||
|
|
||||||
* 35365: Src/exec.c: GLOB_ASSIGN should only affect scalar
|
* 35365: Src/exec.c: GLOB_ASSIGN should only affect scalar
|
||||||
|
|
|
@ -419,14 +419,14 @@
|
||||||
>worldliness
|
>worldliness
|
||||||
>world
|
>world
|
||||||
|
|
||||||
integer i n x
|
(integer i n x
|
||||||
float f
|
float f
|
||||||
setopt globassign
|
setopt globassign
|
||||||
i=tmpfile1
|
i=tmpfile1
|
||||||
n=tmp*
|
n=tmpf*
|
||||||
x=*2
|
x=*2
|
||||||
f=2+2
|
f=2+2
|
||||||
typeset -p i n x f
|
typeset -p i n x f)
|
||||||
0:GLOB_ASSIGN with numeric types
|
0:GLOB_ASSIGN with numeric types
|
||||||
>typeset -i i=0
|
>typeset -i i=0
|
||||||
>typeset -a n
|
>typeset -a n
|
||||||
|
@ -434,6 +434,25 @@
|
||||||
>typeset x=tmpfile2
|
>typeset x=tmpfile2
|
||||||
>typeset -E f=4.000000000e+00
|
>typeset -E f=4.000000000e+00
|
||||||
|
|
||||||
|
setopt globassign
|
||||||
|
foo=tmpf*
|
||||||
|
print $foo
|
||||||
|
unsetopt globassign
|
||||||
|
foo=tmpf*
|
||||||
|
print $foo
|
||||||
|
0:GLOB_ASSIGN option
|
||||||
|
>tmpfile1 tmpfile2
|
||||||
|
>tmpf*
|
||||||
|
|
||||||
|
(setopt globassign
|
||||||
|
typeset -A foo
|
||||||
|
touch gatest1 gatest2
|
||||||
|
foo=(gatest*)
|
||||||
|
print ${(t)foo}
|
||||||
|
rm -rf gatest*)
|
||||||
|
0:GLOB_ASSIGN doesn't monkey with type if not scalar assignment.
|
||||||
|
>association-local
|
||||||
|
|
||||||
A=(first second)
|
A=(first second)
|
||||||
A="${A[*]}" /bin/sh -c 'echo $A'
|
A="${A[*]}" /bin/sh -c 'echo $A'
|
||||||
print -l "${A[@]}"
|
print -l "${A[@]}"
|
||||||
|
|
|
@ -473,15 +473,7 @@
|
||||||
>outside2 scalar
|
>outside2 scalar
|
||||||
>inside3 scalar-export
|
>inside3 scalar-export
|
||||||
|
|
||||||
setopt globassign
|
# GLOB_ASSIGN is tested in A06assign.ztst.
|
||||||
foo=tmp*
|
|
||||||
print $foo
|
|
||||||
unsetopt globassign
|
|
||||||
foo=tmp*
|
|
||||||
print $foo
|
|
||||||
0:GLOB_ASSIGN option
|
|
||||||
>tmpcd tmpfile1 tmpfile2
|
|
||||||
>tmp*
|
|
||||||
|
|
||||||
mkdir onlysomefiles
|
mkdir onlysomefiles
|
||||||
touch onlysomefiles/.thisfile onlysomefiles/thatfile
|
touch onlysomefiles/.thisfile onlysomefiles/thatfile
|
||||||
|
|
Loading…
Reference in a new issue