aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/rwarray.awk7
2 files changed, 11 insertions, 1 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index fa12aefc..a2dbdc5a 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/test/rwarray.awk b/test/rwarray.awk
index 83c3ccdd..70809b64 100644
--- a/test/rwarray.awk
+++ b/test/rwarray.awk
@@ -4,7 +4,8 @@ BEGIN {
while ((getline word) > 0)
dict[word] = word word
- dict["/typed-regex/"] = @/search me/
+ re_sub = "/typed-regex/"
+ dict[re_sub] = @/search me/
n = asorti(dict, dictindices)
for (i = 1; i <= n; i++)
@@ -38,4 +39,8 @@ 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]));
}