Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Inconsistency of GLOB_ASSIGN



On Nov 28,  9:34am, Peter Stephenson wrote:
}
} Given there not much difference, it would probably be better to stick
} with the one that does scalar assignment in the case of a single entry.

OK, here's a test.  Is the floating point output of "typeset -p"
consistent, or are there going to be platform differences that require
a different parse?  (I stuck with a power of 2 to avoid rounding.)


diff --git a/Test/A06assign.ztst b/Test/A06assign.ztst
index 9a0a4f0..3c9ea08 100644
--- a/Test/A06assign.ztst
+++ b/Test/A06assign.ztst
@@ -1,5 +1,10 @@
 # Tests of parameter assignments
 
+%prep
+  mkdir assign.tmp && cd assign.tmp
+
+  touch tmpfile1 tmpfile2
+
 %test
 
  typeset -A assoc
@@ -413,3 +418,18 @@
 >world
 >worldliness
 >world
+
+ integer i n x
+ float f
+ setopt globassign
+ i=tmpfile1
+ n=tmp*
+ x=*2
+ f=2+2
+ typeset -p i n x f
+0:GLOB_ASSIGN with numeric types
+>typeset -i i=0
+>typeset -a n
+>n=(tmpfile1 tmpfile2)
+>typeset x=tmpfile2
+>typeset -E f=4.000000000e+00



Messages sorted by: Reverse Date, Date, Thread, Author