tests: begin migrating test triples into perl framework
* testsuite/head.good: Delete file. * testsuite/head.inp: Likewise. * testsuite/head.sed: Likewise. * testsuite/space.good: Likewise * testsuite/space.inp: Likewise. * testsuite/space.sed: Likewise. * testsuite/empty.good: Likewise * testsuite/empty.inp: Likewise. * testsuite/empty.sed: Likewise. * testsuite/zero-anchor.good: Likewise * testsuite/zero-anchor.inp: Likewise. * testsuite/zero-anchor.sed: Likewise. * testsuite/misc.pl: New file, subsuming the above, with one test for each of the test file triples (input, output, sed commands). (empty, empty2, head, space, zero-anchor): Converted tests. * testsuite/local.mk: Remove references to deleted files. (T): Add misc.pl.
This commit is contained in:
1 parent
27815344e5
commit
0eaa3cf946
14 files changed
+54
-47
No files matched your search
@@ -1,2 +0,0 @@
|
||||
x
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
x
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
s/^ *//
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1 +0,0 @@
|
||||
3q
|
||||
+5
-18
@@ -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.
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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;
|
||||
@@ -1,2 +0,0 @@
|
||||
Hello_World_!
|
||||
SecondXXine__of_tests
|
||||
@@ -1,2 +0,0 @@
|
||||
Hello World !
|
||||
Second_line_ of tests
|
||||
@@ -1 +0,0 @@
|
||||
s/_\S/XX/g;s/\s/_/g
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
N
|
||||
N
|
||||
s/^/X/g
|
||||
s/^/X/mg
|
||||
s/$/Y/g
|
||||
s/$/Y/mg
|
||||
Reference in new issue
Block a user