From dc25e19e710fffd27cd06411dfa5918322ca8be7 Mon Sep 17 00:00:00 2001 From: fanf Date: Wed, 4 Jun 2003 15:26:23 +0000 Subject: Add tests for the behaviour of substitution when the regex can match a zero-length string. This shows bugs in the s///g and s///2+ cases. --- tools/regression/usr.bin/sed/regress.s3.out | 1 + tools/regression/usr.bin/sed/regress.s4.out | 1 + tools/regression/usr.bin/sed/regress.s5.out | 1 + tools/regression/usr.bin/sed/regress.sg.out | 1 + tools/regression/usr.bin/sed/regress.sh | 4 ++++ 5 files changed, 8 insertions(+) create mode 100644 tools/regression/usr.bin/sed/regress.s3.out create mode 100644 tools/regression/usr.bin/sed/regress.s4.out create mode 100644 tools/regression/usr.bin/sed/regress.s5.out create mode 100644 tools/regression/usr.bin/sed/regress.sg.out (limited to 'tools') diff --git a/tools/regression/usr.bin/sed/regress.s3.out b/tools/regression/usr.bin/sed/regress.s3.out new file mode 100644 index 0000000..68dfa9b --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.s3.out @@ -0,0 +1 @@ +fo,o diff --git a/tools/regression/usr.bin/sed/regress.s4.out b/tools/regression/usr.bin/sed/regress.s4.out new file mode 100644 index 0000000..03914ba --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.s4.out @@ -0,0 +1 @@ +foo, diff --git a/tools/regression/usr.bin/sed/regress.s5.out b/tools/regression/usr.bin/sed/regress.s5.out new file mode 100644 index 0000000..257cc56 --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.s5.out @@ -0,0 +1 @@ +foo diff --git a/tools/regression/usr.bin/sed/regress.sg.out b/tools/regression/usr.bin/sed/regress.sg.out new file mode 100644 index 0000000..7b24f2c --- /dev/null +++ b/tools/regression/usr.bin/sed/regress.sg.out @@ -0,0 +1 @@ +,f,o,o, diff --git a/tools/regression/usr.bin/sed/regress.sh b/tools/regression/usr.bin/sed/regress.sh index 15ab0e6..fc5a135 100644 --- a/tools/regression/usr.bin/sed/regress.sh +++ b/tools/regression/usr.bin/sed/regress.sh @@ -7,5 +7,9 @@ REGRESSION_TEST(`P', `sed P < regress.in') REGRESSION_TEST(`psl', `sed \$!g\;P\;D < regress.in') REGRESSION_TEST(`bcb', `sed s/X/$(jot -n -bx -s "" 2043)\\\\zz/ < regress.in') REGRESSION_TEST(`y', `echo -n foo | sed y/o/O/') +REGRESSION_TEST(`sg', `echo foo | sed s/,*/,/g') +REGRESSION_TEST(`s3', `echo foo | sed s/,*/,/3') +REGRESSION_TEST(`s4', `echo foo | sed s/,*/,/4') +REGRESSION_TEST(`s5', `echo foo | sed s/,*/,/5') REGRESSION_END() -- cgit v1.1