diff --git a/testsuite/empty.good b/testsuite/empty.good deleted file mode 100644 index 07e1a15..0000000 --- a/testsuite/empty.good +++ /dev/null @@ -1,2 +0,0 @@ -x - diff --git a/testsuite/empty.inp b/testsuite/empty.inp deleted file mode 100644 index 07e1a15..0000000 --- a/testsuite/empty.inp +++ /dev/null @@ -1,2 +0,0 @@ -x - diff --git a/testsuite/empty.sed b/testsuite/empty.sed deleted file mode 100644 index b35aed6..0000000 --- a/testsuite/empty.sed +++ /dev/null @@ -1 +0,0 @@ -s/^ *// diff --git a/testsuite/head.good b/testsuite/head.good deleted file mode 100644 index 6392831..0000000 --- a/testsuite/head.good +++ /dev/null @@ -1,3 +0,0 @@ - "...by imposing a tiny bit of order in a communication you are - translating, you are carving out a little bit of order in the - universe. You will never succeed. Everything will fail and come diff --git a/testsuite/head.inp b/testsuite/head.inp deleted file mode 100644 index 5c4b4a4..0000000 --- a/testsuite/head.inp +++ /dev/null @@ -1,9 +0,0 @@ - "...by imposing a tiny bit of order in a communication you are - translating, you are carving out a little bit of order in the - universe. You will never succeed. Everything will fail and come - to an end finally. But you have a chance to carve a little bit - of order and maybe even beauty out of the raw materials that - surround you everywhere, and I think there is no greater meaning - in life." - - Donald L. Philippi, Oct 1930 - Jan 1993 diff --git a/testsuite/head.sed b/testsuite/head.sed deleted file mode 100644 index d8ea37d..0000000 --- a/testsuite/head.sed +++ /dev/null @@ -1 +0,0 @@ -3q diff --git a/testsuite/local.mk b/testsuite/local.mk index 0670d76..3f32b51 100644 --- a/testsuite/local.mk +++ b/testsuite/local.mk @@ -39,6 +39,7 @@ PL_LOG_COMPILER = $(TESTSUITE_PERL) $(TESTSUITE_PERL_OPTIONS) # is listed in only one place. T = \ + testsuite/misc.pl \ testsuite/cmd-l.sh \ testsuite/cmd-R.sh \ testsuite/colon-with-no-label.sh \ @@ -103,8 +104,6 @@ check_PROGRAMS += testsuite/bug-regex7 \ testsuite/bug-regex21 testsuite/bug-regex27 testsuite/bug-regex28 \ testsuite/tst-pcre testsuite/tst-boost testsuite/runtests \ testsuite/runptests testsuite/tst-rxspencer testsuite/tst-regex2 - -SEDTESTS += space endif SEDTESTS += testsuite/appquit testsuite/enable testsuite/sep \ @@ -113,8 +112,8 @@ SEDTESTS += testsuite/appquit testsuite/enable testsuite/sep \ testsuite/noeolw testsuite/modulo testsuite/numsub \ testsuite/numsub2 testsuite/numsub3 testsuite/numsub4 \ testsuite/numsub5 testsuite/0range testsuite/bkslashes \ - testsuite/head testsuite/madding testsuite/mac-mf \ - testsuite/empty testsuite/xbxcx testsuite/xbxcx3 \ + testsuite/madding testsuite/mac-mf \ + testsuite/xbxcx testsuite/xbxcx3 \ testsuite/recall testsuite/recall2 testsuite/xemacs \ testsuite/fasts testsuite/uniq testsuite/manis \ testsuite/khadafy testsuite/linecnt testsuite/eval \ @@ -129,7 +128,7 @@ SEDTESTS += testsuite/appquit testsuite/enable testsuite/sep \ testsuite/amp-escape testsuite/help testsuite/file \ testsuite/quiet testsuite/factor testsuite/binary3 \ testsuite/binary2 testsuite/binary testsuite/dc \ - testsuite/newline-anchor testsuite/zero-anchor + testsuite/newline-anchor # Note that the first lines are statements. They ensure that environment # variables that can perturb tests are unset or set to expected values. @@ -240,9 +239,6 @@ EXTRA_DIST += \ testsuite/dollar.good \ testsuite/dollar.inp \ testsuite/dollar.sed \ - testsuite/empty.good \ - testsuite/empty.inp \ - testsuite/empty.sed \ testsuite/enable.good \ testsuite/enable.inp \ testsuite/enable.sed \ @@ -258,9 +254,6 @@ EXTRA_DIST += \ testsuite/flipcase.good \ testsuite/flipcase.inp \ testsuite/flipcase.sed \ - testsuite/head.good \ - testsuite/head.inp \ - testsuite/head.sed \ testsuite/inclib.good \ testsuite/inclib.inp \ testsuite/inclib.sed \ @@ -276,9 +269,6 @@ EXTRA_DIST += \ testsuite/linecnt.good \ testsuite/linecnt.inp \ testsuite/linecnt.sed \ - testsuite/space.good \ - testsuite/space.inp \ - testsuite/space.sed \ testsuite/mac-mf.good \ testsuite/mac-mf.inp \ testsuite/mac-mf.sed \ @@ -380,10 +370,7 @@ EXTRA_DIST += \ testsuite/y-zero.inp \ testsuite/y-newline.good \ testsuite/y-newline.sed \ - testsuite/y-newline.inp \ - testsuite/zero-anchor.good \ - testsuite/zero-anchor.sed \ - testsuite/zero-anchor.inp + testsuite/y-newline.inp # automake makes `check' depend on $(TESTS). Declare # dummy targets for $(TESTS) so that make does not complain. diff --git a/testsuite/misc.pl b/testsuite/misc.pl new file mode 100644 index 0000000..7ec6e05 --- /dev/null +++ b/testsuite/misc.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl +# Test misc. + +# Copyright (C) 2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +use strict; +use File::stat; + +(my $program_name = $0) =~ s|.*/||; + +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +my $prog = 'sed'; + +print "PATH = $ENV{PATH}\n"; + +my @Tests = + ( + ['empty', qw(-e ''), {IN=>''}, {OUT=>''}], + ['empty2', q('s/^ *//'), {IN=>"x\n\n"}, {OUT=>"x\n\n"}], + + ['head', qw(3q), {IN=>"1\n2\n3\n4\n"}, {OUT=>"1\n2\n3\n"}], + ['space', q('s/_\S/XX/g;s/\s/_/g'), + {IN=> "Hello World\t!\nSecond_line_ of tests\n" }, + {OUT=> "Hello_World_!\nSecondXXine__of_tests\n" }], + ['zero-anchor', qw(-z), q('N;N;s/^/X/g;s/^/X/mg;s/$/Y/g;s/$/Y/mg'), + {IN=>"a\0b\0c\0" }, + {OUT=>"XXaY\0XbY\0XcYY\0" }], + ); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); +exit $fail; diff --git a/testsuite/space.good b/testsuite/space.good deleted file mode 100644 index 9b267aa..0000000 --- a/testsuite/space.good +++ /dev/null @@ -1,2 +0,0 @@ -Hello_World_! -SecondXXine__of_tests diff --git a/testsuite/space.inp b/testsuite/space.inp deleted file mode 100644 index 83b0adb..0000000 --- a/testsuite/space.inp +++ /dev/null @@ -1,2 +0,0 @@ -Hello World ! -Second_line_ of tests diff --git a/testsuite/space.sed b/testsuite/space.sed deleted file mode 100644 index 0bfa522..0000000 --- a/testsuite/space.sed +++ /dev/null @@ -1 +0,0 @@ -s/_\S/XX/g;s/\s/_/g diff --git a/testsuite/zero-anchor.good b/testsuite/zero-anchor.good deleted file mode 100644 index a62d3b4..0000000 Binary files a/testsuite/zero-anchor.good and /dev/null differ diff --git a/testsuite/zero-anchor.inp b/testsuite/zero-anchor.inp deleted file mode 100644 index 7207ec4..0000000 Binary files a/testsuite/zero-anchor.inp and /dev/null differ diff --git a/testsuite/zero-anchor.sed b/testsuite/zero-anchor.sed deleted file mode 100644 index b3d2de1..0000000 --- a/testsuite/zero-anchor.sed +++ /dev/null @@ -1,6 +0,0 @@ -N -N -s/^/X/g -s/^/X/mg -s/$/Y/g -s/$/Y/mg