diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 5 | ||||
-rw-r--r-- | test/Makefile.in | 10 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/anchor.awk | 33 | ||||
-rw-r--r-- | test/anchor.in | 3 | ||||
-rw-r--r-- | test/anchor.ok | 6 |
7 files changed, 65 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 54706d49..3a16e2a8 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2016-09-09 Norihiro Tanaka <noritnk@kcn.ne.jp> + + * Makefile.am (anchor): New test. + * anchor.awk, anchor.in, anchor.ok: New files. + 2016-08-25 Arnold D. Robbins <arnold@skeeve.com> * 4.1.4: Release tar ball made. diff --git a/test/Makefile.am b/test/Makefile.am index 1e65ea1d..b0bfc128 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -47,6 +47,9 @@ EXTRA_DIST = \ anchgsub.awk \ anchgsub.in \ anchgsub.ok \ + anchor.awk \ + anchor.in \ + anchor.ok \ apiterm.awk \ apiterm.in \ apiterm.ok \ @@ -1155,7 +1158,7 @@ CLEANFILES = core core.* fmtspcl.ok # try to keep these sorted. each letter starts a new line BASIC_TESTS = \ - addcomma anchgsub argarray arrayind1 arrayind2 arrayind3 arrayparm arrayprm2 arrayprm3 \ + addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayind3 arrayparm arrayprm2 arrayprm3 \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 aryprm9 arysubnm asgext awkpath \ diff --git a/test/Makefile.in b/test/Makefile.in index 9610b720..1c4514bb 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -304,6 +304,9 @@ EXTRA_DIST = \ anchgsub.awk \ anchgsub.in \ anchgsub.ok \ + anchor.awk \ + anchor.in \ + anchor.ok \ apiterm.awk \ apiterm.in \ apiterm.ok \ @@ -1411,7 +1414,7 @@ CLEANFILES = core core.* fmtspcl.ok # try to keep these sorted. each letter starts a new line BASIC_TESTS = \ - addcomma anchgsub argarray arrayind1 arrayind2 arrayind3 arrayparm arrayprm2 arrayprm3 \ + addcomma anchgsub anchor argarray arrayind1 arrayind2 arrayind3 arrayparm arrayprm2 arrayprm3 \ arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 aryprm9 arysubnm asgext awkpath \ @@ -2808,6 +2811,11 @@ anchgsub: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +anchor: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + arrayind1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index fcbd1d28..ebdf6901 100644 --- a/test/Maketests +++ b/test/Maketests @@ -10,6 +10,11 @@ anchgsub: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +anchor: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + arrayind1: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/anchor.awk b/test/anchor.awk new file mode 100644 index 00000000..56f47569 --- /dev/null +++ b/test/anchor.awk @@ -0,0 +1,33 @@ +BEGIN { RS = "" } + +{ + if (/^A/) + print "ok" + else + print "not ok" + + if (/B$/) + print "not ok" + else + print "ok" + + if (/^C/) + print "not ok" + else + print "ok" + + if (/D$/) + print "not ok" + else + print "ok" + + if (/^E/) + print "not ok" + else + print "ok" + + if (/F$/) + print "ok" + else + print "not ok" +} diff --git a/test/anchor.in b/test/anchor.in new file mode 100644 index 00000000..a97e9859 --- /dev/null +++ b/test/anchor.in @@ -0,0 +1,3 @@ +A line1 B +C line2 D +E line3 F diff --git a/test/anchor.ok b/test/anchor.ok new file mode 100644 index 00000000..7780b88b --- /dev/null +++ b/test/anchor.ok @@ -0,0 +1,6 @@ +ok +ok +ok +ok +ok +ok |