aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-12-22 18:32:21 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-12-22 18:32:21 +0200
commit6402c9480ffcd8610b1322a381f0c14a42d95083 (patch)
treebbf1f2c00923c562b1ff346b5a6b759d58920902 /test
parent2af62b50e5b9574c0e169fb4d99c4912e56eef1f (diff)
parentaf31a6de1bd15d4d5f5520ebfcb1d24239b9a683 (diff)
downloadegawk-6402c9480ffcd8610b1322a381f0c14a42d95083.tar.gz
egawk-6402c9480ffcd8610b1322a381f0c14a42d95083.tar.bz2
egawk-6402c9480ffcd8610b1322a381f0c14a42d95083.zip
Merge branch 'master' into feature/fix-comments
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog14
-rw-r--r--test/rwarray.awk16
2 files changed, 29 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 40988c56..d2b0cf79 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,17 @@
+2016-12-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * rwarray.awk: Check that strnum is recreated correctly.
+
+2016-11-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * rwarray.awk: Use typeof() to verify that typed regex is
+ created correctly upon reading.
+
+2016-11-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * rwarray.awk: Add a typed regex into the array before
+ writing it out and reading it back.
+
2016-11-21 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): Add valgrind.awk to the list.
diff --git a/test/rwarray.awk b/test/rwarray.awk
index 0cb214ee..86a4b589 100644
--- a/test/rwarray.awk
+++ b/test/rwarray.awk
@@ -4,6 +4,13 @@ BEGIN {
while ((getline word) > 0)
dict[word] = word word
+ re_sub = "/typed-regex/"
+ dict[re_sub] = @/search me/
+
+ strnum_sub = "strnum-sub"
+ split("-2.4", f)
+ dict[strnum_sub] = f[1]
+
n = asorti(dict, dictindices)
for (i = 1; i <= n; i++)
printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "orig.out"
@@ -12,7 +19,6 @@ BEGIN {
ret = writea("orig.bin", dict)
printf "writea() returned %d, expecting 1\n", ret
-
ret = reada("orig.bin", dict)
printf "reada() returned %d, expecting 1\n", ret
@@ -37,4 +43,12 @@ BEGIN {
if (ret == 0 && !("KEEPIT" in ENVIRON))
system("rm -f orig.bin orig.out new.out")
}
+
+ if (typeof(dict[re_sub]) != "regexp")
+ printf("dict[\"%s\"] should be regexp, is %s\n",
+ re_sub, typeof(dict[re_sub]));
+
+ if (typeof(dict[strnum_sub]) != "strnum")
+ printf("dict[\"%s\"] should be strnum, is %s\n",
+ strnum_sub, typeof(dict[strnum_sub]));
}