summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-06-02 16:23:08 +0100
committerPeter Stephenson <pws@zsh.org>2015-06-02 16:23:08 +0100
commit897ad466920e6d46d317e0630b5263d4c37c907f (patch)
tree942edffd7b5b9cb21d49fbc0ce929aabda62c7ce
parent4dc4e23376888697234e00e0c34184bb308886e1 (diff)
downloadzsh-897ad466920e6d46d317e0630b5263d4c37c907f.tar.gz
zsh-897ad466920e6d46d317e0630b5263d4c37c907f.tar.xz
zsh-897ad466920e6d46d317e0630b5263d4c37c907f.zip
35369: better GLOB_ASSIGN testing
-rw-r--r--ChangeLog5
-rw-r--r--Test/A06assign.ztst25
-rw-r--r--Test/E01options.ztst10
3 files changed, 28 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index acb367b83..9451f88df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
 	* 35365: Src/exec.c: GLOB_ASSIGN should only affect scalar
diff --git a/Test/A06assign.ztst b/Test/A06assign.ztst
index 0ad9a0aca..a4401cb67 100644
--- a/Test/A06assign.ztst
+++ b/Test/A06assign.ztst
@@ -419,14 +419,14 @@
 >worldliness
 >world
 
- integer i n x
+ (integer i n x
  float f
  setopt globassign
  i=tmpfile1
- n=tmp*
+ n=tmpf*
  x=*2
  f=2+2
- typeset -p i n x f
+ typeset -p i n x f)
 0:GLOB_ASSIGN with numeric types
 >typeset -i i=0
 >typeset -a n
@@ -434,6 +434,25 @@
 >typeset x=tmpfile2
 >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="${A[*]}" /bin/sh -c 'echo $A'
  print -l "${A[@]}"
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index 5c453c80b..d64f7ac68 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -473,15 +473,7 @@
 >outside2 scalar
 >inside3 scalar-export
 
-  setopt globassign
-  foo=tmp*
-  print $foo
-  unsetopt globassign
-  foo=tmp*
-  print $foo
-0:GLOB_ASSIGN option
->tmpcd tmpfile1 tmpfile2
->tmp*
+# GLOB_ASSIGN is tested in A06assign.ztst.
 
   mkdir onlysomefiles
   touch onlysomefiles/.thisfile onlysomefiles/thatfile