aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog12
-rw-r--r--test/Makefile.am17
-rw-r--r--test/Makefile.in19
-rw-r--r--test/fwtest2b.awk6
-rw-r--r--test/fwtest2b.ok12
5 files changed, 61 insertions, 5 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index df0ed8fa..46c52626 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2017-03-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (fwtest2b): Add new test of enhanced FIELDWIDTHS syntax.
+ * fwtest2b.awk, fwtest2b.ok: New files.
+
2017-03-19 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.am (argarray): Always copy argarray.in to the local
@@ -5,6 +10,13 @@
$(srcdir) is the current directory.
* argarray.ok: Replace argarray.in with argarray.input.
+2017-03-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.am (readdir_test): New test to check whether get_record
+ field_width parsing is working by comparing the results from the
+ readdir and readdir_test extensions.
+ (SHLIB_TESTS): Add readdir_test.
+
2017-02-21 Andrew J. Schorr <aschorr@telemetry-investments.com>
* Makefile.am (mktime): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index a356d63b..b46f36e3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -385,6 +385,8 @@ EXTRA_DIST = \
fwtest2.awk \
fwtest2.in \
fwtest2.ok \
+ fwtest2b.awk \
+ fwtest2b.ok \
fwtest3.awk \
fwtest3.in \
fwtest3.ok \
@@ -1221,7 +1223,7 @@ GAWK_EXT_TESTS = \
crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \
devfd devfd1 devfd2 dumpvars errno exit \
fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \
- functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
+ functab1 functab2 functab3 fwtest fwtest2 fwtest2b fwtest3 \
genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \
icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase \
incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
@@ -1263,7 +1265,7 @@ LOCALE_CHARSET_TESTS = \
SHLIB_TESTS = \
apiterm fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \
- ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time
+ ordchr ordchr2 readdir readdir_test readfile readfile2 revout revtwoway rwarray testext time
# List of the tests which should be run with --lint option:
NEED_LINT = \
@@ -2187,6 +2189,12 @@ readdir:
-v dirlist=_dirlist -v longlist=_longlist > $@.ok
@-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ _dirlist _longlist
+readdir_test:
+ @echo $@
+ @$(AWK) -lreaddir -F/ '{printf "[%s] [%s] [%s] [%s]\n", $$1, $$2, $$3, $$4}' "$(top_srcdir)" > $@.ok
+ @$(AWK) -lreaddir_test '{printf "[%s] [%s] [%s] [%s]\n", $$1, $$2, $$3, $$4}' "$(top_srcdir)" > _$@
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
fts:
@case `uname` in \
IRIX) \
@@ -2367,6 +2375,11 @@ arrdbg:
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok
# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok || exit 0
+fwtest2b:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/fwtest2.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 8719840b..fe449734 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -643,6 +643,8 @@ EXTRA_DIST = \
fwtest2.awk \
fwtest2.in \
fwtest2.ok \
+ fwtest2b.awk \
+ fwtest2b.ok \
fwtest3.awk \
fwtest3.in \
fwtest3.ok \
@@ -1478,7 +1480,7 @@ GAWK_EXT_TESTS = \
crlf dbugeval dbugeval2 dbugtypedre1 dbugtypedre2 delsub \
devfd devfd1 devfd2 dumpvars errno exit \
fieldwdth forcenum fpat1 fpat2 fpat3 fpat4 fpat5 fpatnull fsfwfs funlen \
- functab1 functab2 functab3 fwtest fwtest2 fwtest3 \
+ functab1 functab2 functab3 fwtest fwtest2 fwtest2b fwtest3 \
genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \
icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase \
incdupe incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 \
@@ -1516,7 +1518,7 @@ LOCALE_CHARSET_TESTS = \
SHLIB_TESTS = \
apiterm fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \
- ordchr ordchr2 readdir readfile readfile2 revout revtwoway rwarray testext time
+ ordchr ordchr2 readdir readdir_test readfile readfile2 revout revtwoway rwarray testext time
# List of the tests which should be run with --lint option:
@@ -2626,6 +2628,12 @@ readdir:
-v dirlist=_dirlist -v longlist=_longlist > $@.ok
@-$(CMP) $@.ok _$@ && rm -f $@.ok _$@ _dirlist _longlist
+readdir_test:
+ @echo $@
+ @$(AWK) -lreaddir -F/ '{printf "[%s] [%s] [%s] [%s]\n", $$1, $$2, $$3, $$4}' "$(top_srcdir)" > $@.ok
+ @$(AWK) -lreaddir_test '{printf "[%s] [%s] [%s] [%s]\n", $$1, $$2, $$3, $$4}' "$(top_srcdir)" > _$@
+ @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
+
fts:
@case `uname` in \
IRIX) \
@@ -2803,6 +2811,12 @@ arrdbg:
@echo $@
@$(AWK) -v "okfile=$(srcdir)/$@.ok" -f "$(srcdir)"/$@.awk | grep array_f >_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok
+# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok || exit 0
+
+fwtest2b:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/fwtest2.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -4457,7 +4471,6 @@ time:
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
# end of file Maketests
-# @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ "$(srcdir)"/$@.ok || exit 0
# Targets generated for other tests:
diff --git a/test/fwtest2b.awk b/test/fwtest2b.awk
new file mode 100644
index 00000000..5e96c1aa
--- /dev/null
+++ b/test/fwtest2b.awk
@@ -0,0 +1,6 @@
+BEGIN {
+ FIELDWIDTHS = "2:13 2:13 2:13";
+}
+{
+ printf "%s|%s|%s\n", $1, $2, $3
+}
diff --git a/test/fwtest2b.ok b/test/fwtest2b.ok
new file mode 100644
index 00000000..f4d28232
--- /dev/null
+++ b/test/fwtest2b.ok
@@ -0,0 +1,12 @@
+ 0.4867373206| 1.3206333033|-0.2333178127
+ 0.5668176165| 1.3711756314|-0.2193558040
+ 0.4325251781| 1.3399488722|-0.1568307497
+ 0.4900487563| 1.3295759570|-0.2217392402
+-0.6790064191| 1.2536623801|-0.2955415433
+-0.6311440220| 1.2966579993|-0.2246692210
+-0.7209390351| 1.1783407099|-0.2539408209
+-0.6782473356| 1.2495242556|-0.2811436366
+-0.7062054082| 1.1223820964|-1.1619805834
+-0.6491590119| 1.1248946162|-1.0851579675
+-0.7948856821| 1.1208852325|-1.1259821556
+-0.7102549262| 1.1225121126|-1.1475381286