diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 1 | ||||
-rw-r--r-- | test/rwarray.awk | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 0212e1ff..a65ff619 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -2,6 +2,7 @@ * Makefile.am (EXTRA_DIST): asortbool, new test. * asortbool.awk, asortbool.ok: New files. + * rwarray.awk: Add test of saving/restoring bool values. 2021-03-08 Arnold D. Robbins <arnold@skeeve.com> diff --git a/test/rwarray.awk b/test/rwarray.awk index 86a4b589..831f17c3 100644 --- a/test/rwarray.awk +++ b/test/rwarray.awk @@ -11,6 +11,9 @@ BEGIN { split("-2.4", f) dict[strnum_sub] = f[1] + bool_sub = "bool-sub" + dict[bool_sub] = bool(1) + n = asorti(dict, dictindices) for (i = 1; i <= n; i++) printf("dict[%s] = %s\n", dictindices[i], dict[dictindices[i]]) > "orig.out" @@ -51,4 +54,12 @@ BEGIN { if (typeof(dict[strnum_sub]) != "strnum") printf("dict[\"%s\"] should be strnum, is %s\n", strnum_sub, typeof(dict[strnum_sub])); + + if (typeof(dict[bool_sub]) != "bool") + printf("dict[\"%s\"] should be bool, is %s\n", + bool_sub, typeof(dict[bool_sub])); + + if ((dict[bool_sub] "") != "TRUE") + printf("dict[\"%s\"] should be TRUE, is %s\n", + bool_sub, dict[bool_sub]); } |