summaryrefslogtreecommitdiff
path: root/test/arraysort.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-04-01 11:58:20 +0300
committerArnold D. Robbins <arnold@skeeve.com>2011-04-01 11:58:20 +0300
commitd806340faadd79524b3adccef6cbced20cd88396 (patch)
tree31ff37862e0603576bf3c0111149af70ff7578ef /test/arraysort.awk
parent6aed27e0a553cb31800bbaeee1bf8e96a98abb12 (diff)
downloadgawk-d806340faadd79524b3adccef6cbced20cd88396.tar.gz
Fix array sorting, add test case.
Diffstat (limited to 'test/arraysort.awk')
-rw-r--r--test/arraysort.awk11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/arraysort.awk b/test/arraysort.awk
new file mode 100644
index 00000000..28535528
--- /dev/null
+++ b/test/arraysort.awk
@@ -0,0 +1,11 @@
+# Date: Thu, 31 Mar 2011 12:29:09 -0600
+# From: j.eh@mchsi.com
+
+BEGIN { a[100]=a[1]=a["x"]=a["y"]=1; PROCINFO["sorted_in"]="num";
+for (i in a) print i, a[i] }
+
+BEGIN { a[100]=a[1]=a["x"]=1; PROCINFO["sorted_in"]="num";
+for (i in a) print i, a[i] }
+
+BEGIN { a[0]=a[100]=a[1]=a["x"]=1; PROCINFO["sorted_in"]="num";
+for (i in a) print i, a[i] }