summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2017-04-28 20:26:10 -0400
committerAssaf Gordon <assafgordon@gmail.com>2017-05-10 21:39:57 -0400
commitb85182196acfc99a524c0a17528efad073966aeb (patch)
tree7582d81756f5ad2b85c915e38f0837274db20e6e /testsuite
parent0ea46106d3abbae745eddb3ab2d43d1a61c2c3c2 (diff)
downloadsed-b85182196acfc99a524c0a17528efad073966aeb.tar.gz
tests: convert "noeolw" test to new framework
* testsuite/misc.pl (Tests): Add noeolw. * testsuite/noeolw.good: Delete file. * testsuite/noeolw.1good: Likewise. * testsuite/noeolw.2good: Likewise * testsuite/noeolw.inp: Likewise. * testsuite/noeolw.sed: Likewise. * testsuite/local.mk (EXTRA_DIST): Remove their names. (SEDTESTS): Remove "noeolw".
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/local.mk8
-rw-r--r--testsuite/misc.pl56
-rw-r--r--testsuite/noeolw.1good7
-rw-r--r--testsuite/noeolw.2good3
-rw-r--r--testsuite/noeolw.good12
-rw-r--r--testsuite/noeolw.inp3
-rw-r--r--testsuite/noeolw.sed10
7 files changed, 56 insertions, 43 deletions
diff --git a/testsuite/local.mk b/testsuite/local.mk
index 1846420..e906fe3 100644
--- a/testsuite/local.mk
+++ b/testsuite/local.mk
@@ -123,9 +123,6 @@ check_PROGRAMS += testsuite/bug-regex7 \
testsuite/runptests testsuite/tst-rxspencer testsuite/tst-regex2
endif
-SEDTESTS += testsuite/noeolw
-
-
# Note that the first lines are statements. They ensure that environment
# variables that can perturb tests are unset or set to expected values.
# The rest are envvar settings that propagate build-related Makefile
@@ -203,11 +200,6 @@ EXTRA_DIST += \
testsuite/madding.good \
testsuite/madding.inp \
testsuite/madding.sed \
- testsuite/noeolw.good \
- testsuite/noeolw.inp \
- testsuite/noeolw.1good \
- testsuite/noeolw.2good \
- testsuite/noeolw.sed \
testsuite/uniq.good \
testsuite/uniq.inp \
testsuite/uniq.sed \
diff --git a/testsuite/misc.pl b/testsuite/misc.pl
index aee00f6..fa1e48e 100644
--- a/testsuite/misc.pl
+++ b/testsuite/misc.pl
@@ -940,6 +940,62 @@ s/$/Y/mg
. "XcYY\n"}
],
+ ['noeolw',
+ qw(-n -f),
+ # The sed program:
+ # generates two output files (in addition to STDOUT)
+ {IN => q(w noeolw.1out
+$ {
+ x
+ w noeolw.1out
+ x
+}
+h
+1,3w noeolw.2out
+p
+p
+)},
+ # The input file (was: noeolw.inp).
+ # NOTE: in the old test, the input file was given twice.
+ # here we specify two (identical) input files.
+ {IN => "This file is unique\n" .
+ "in that it does\n" .
+ "end in a newline."},
+ {IN => "This file is unique\n" .
+ "in that it does\n" .
+ "end in a newline."},
+
+ # The expected STDOUT (was: noeolw.good)
+ {OUT => "This file is unique\n" .
+ "This file is unique\n" .
+ "in that it does\n" .
+ "in that it does\n" .
+ "end in a newline.\n" .
+ "end in a newline.\n" .
+ "This file is unique\n" .
+ "This file is unique\n" .
+ "in that it does\n" .
+ "in that it does\n" .
+ "end in a newline.\n" .
+ "end in a newline."},
+
+ # The expected content of 'noeolw.1out' (was: noeolw.1good)
+ {CMP => [ "This file is unique\n" .
+ "in that it does\n" .
+ "end in a newline.\n" .
+ "This file is unique\n" .
+ "in that it does\n" .
+ "end in a newline.\n" .
+ "in that it does\n",
+ { 'noeolw.1out' => undef }]},
+
+ # The expected content of 'noeolw.2out' (was: noeolw.2good)
+ {CMP => [ "This file is unique\n" .
+ "in that it does\n" .
+ "end in a newline.",
+ { 'noeolw.2out' => undef }]},
+ ],
+
['numsub',
qw(-f),
{IN => q(
diff --git a/testsuite/noeolw.1good b/testsuite/noeolw.1good
deleted file mode 100644
index f0f44d9..0000000
--- a/testsuite/noeolw.1good
+++ /dev/null
@@ -1,7 +0,0 @@
-This file is unique
-in that it does
-end in a newline.
-This file is unique
-in that it does
-end in a newline.
-in that it does
diff --git a/testsuite/noeolw.2good b/testsuite/noeolw.2good
deleted file mode 100644
index c4cf6a1..0000000
--- a/testsuite/noeolw.2good
+++ /dev/null
@@ -1,3 +0,0 @@
-This file is unique
-in that it does
-end in a newline. \ No newline at end of file
diff --git a/testsuite/noeolw.good b/testsuite/noeolw.good
deleted file mode 100644
index e76509a..0000000
--- a/testsuite/noeolw.good
+++ /dev/null
@@ -1,12 +0,0 @@
-This file is unique
-This file is unique
-in that it does
-in that it does
-end in a newline.
-end in a newline.
-This file is unique
-This file is unique
-in that it does
-in that it does
-end in a newline.
-end in a newline. \ No newline at end of file
diff --git a/testsuite/noeolw.inp b/testsuite/noeolw.inp
deleted file mode 100644
index c4cf6a1..0000000
--- a/testsuite/noeolw.inp
+++ /dev/null
@@ -1,3 +0,0 @@
-This file is unique
-in that it does
-end in a newline. \ No newline at end of file
diff --git a/testsuite/noeolw.sed b/testsuite/noeolw.sed
deleted file mode 100644
index 0924619..0000000
--- a/testsuite/noeolw.sed
+++ /dev/null
@@ -1,10 +0,0 @@
-w noeolw.1out
-$ {
- x
- w noeolw.1out
- x
-}
-h
-1,3w noeolw.2out
-p
-p