aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-03-11 22:45:22 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-03-11 22:45:22 +0200
commita7c502a756732ec9a1773d6169376bb7b25f4308 (patch)
tree75dd7a168a4e695438fdc2ba4d5959fd24ff2217 /test
parent2b02c5c64a93608c347ffaa312d88d52f93888da (diff)
downloadegawk-a7c502a756732ec9a1773d6169376bb7b25f4308.tar.gz
egawk-a7c502a756732ec9a1773d6169376bb7b25f4308.tar.bz2
egawk-a7c502a756732ec9a1773d6169376bb7b25f4308.zip
Fix a bug with ] as real char in regexps.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am12
-rw-r--r--test/Makefile.in12
-rw-r--r--test/colonwarn.awk4
-rw-r--r--test/colonwarn.in1
-rw-r--r--test/colonwarn.ok3
6 files changed, 35 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index bd78c510..9774277f 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-11 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (colonwarn): New test.
+ * colonwarn.awk, colonwarn.in, colonwarn.ok: New files.
+
2013-02-26 Arnold D. Robbins <arnold@skeeve.com>
* parseme.ok: Update after change in grammar. Now with new and
diff --git a/test/Makefile.am b/test/Makefile.am
index f59aa52a..ee57bdd1 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -134,6 +134,9 @@ EXTRA_DIST = \
clsflnam.awk \
clsflnam.in \
clsflnam.ok \
+ colonwarn.awk \
+ colonwarn.in \
+ colonwarn.ok \
compare.awk \
compare.in \
compare.ok \
@@ -848,7 +851,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
- clos1way delsub devfd devfd1 devfd2 dumpvars exit \
+ colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \
fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
fwtest fwtest2 fwtest3 \
gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
@@ -1487,6 +1490,13 @@ reginttrad:
@$(AWK) --traditional -r -f $@.awk > _$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+colonwarn:
+ @echo $@
+ @for i in 1 2 3 ; \
+ do $(AWK) -f $(srcdir)/$@.awk $$i < $(srcdir)/$@.in ; \
+ done > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index 3066c31c..b6aa3f67 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -338,6 +338,9 @@ EXTRA_DIST = \
clsflnam.awk \
clsflnam.in \
clsflnam.ok \
+ colonwarn.awk \
+ colonwarn.in \
+ colonwarn.ok \
compare.awk \
compare.in \
compare.ok \
@@ -1052,7 +1055,7 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
backw badargs beginfile1 beginfile2 binmode1 charasbytes \
- clos1way delsub devfd devfd1 devfd2 dumpvars exit \
+ colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \
fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
fwtest fwtest2 fwtest3 \
gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
@@ -1863,6 +1866,13 @@ reginttrad:
@echo $@
@$(AWK) --traditional -r -f $@.awk > _$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+colonwarn:
+ @echo $@
+ @for i in 1 2 3 ; \
+ do $(AWK) -f $(srcdir)/$@.awk $$i < $(srcdir)/$@.in ; \
+ done > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/colonwarn.awk b/test/colonwarn.awk
new file mode 100644
index 00000000..0b0650e0
--- /dev/null
+++ b/test/colonwarn.awk
@@ -0,0 +1,4 @@
+BEGIN { pattern = ARGV[1] + 0; delete ARGV }
+pattern == 1 { sub(/[][:space:]]/,""); print }
+pattern == 2 { sub(/[\][:space:]]/,""); print }
+pattern == 3 { sub(/[^][:space:]]/,""); print }
diff --git a/test/colonwarn.in b/test/colonwarn.in
new file mode 100644
index 00000000..d34368d7
--- /dev/null
+++ b/test/colonwarn.in
@@ -0,0 +1 @@
+a]b
diff --git a/test/colonwarn.ok b/test/colonwarn.ok
new file mode 100644
index 00000000..d084ee3d
--- /dev/null
+++ b/test/colonwarn.ok
@@ -0,0 +1,3 @@
+ab
+ab
+]b