diff options
Diffstat (limited to 'test/rwarray.awk')
-rw-r--r-- | test/rwarray.awk | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/rwarray.awk b/test/rwarray.awk index 0cb214ee..70809b64 100644 --- a/test/rwarray.awk +++ b/test/rwarray.awk @@ -4,6 +4,9 @@ BEGIN { while ((getline word) > 0) dict[word] = word word + re_sub = "/typed-regex/" + dict[re_sub] = @/search me/ + n = asorti(dict, dictindices) for (i = 1; i <= n; i++) printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "orig.out" @@ -12,7 +15,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 +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])); } |