Commit Graph
491 Commits
Author SHA1 Message Date
Assaf Gordon 042ea8ebe6 tests: convert "newline-anchor" test to new framework
* testsuite/misc.pl (Tests): Add newline-anchor.
* testsuite/newline-anchor.good: Delete file.
* testsuite/newline-anchor.inp: Likewise.
* testsuite/newline-anchor.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "newline-anchor".
2017-05-10 21:37:20 -04:00
Assaf Gordon ff1d9f9e6e tests: convert "middle" test to new framework
* testsuite/misc.pl (Tests): Add middle.
* testsuite/middle.good: Delete file.
* testsuite/middle.inp: Likewise.
* testsuite/middle.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "middle".
2017-05-10 21:37:20 -04:00
Assaf Gordon e3ca6642c6 tests: convert "xabcx" test to new framework
* testsuite/misc.pl (Tests): Add xabcx.
* testsuite/xabcx.good: Delete file.
* testsuite/xabcx.inp: Likewise.
* testsuite/xabcx.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "xabcx".
2017-05-10 21:37:19 -04:00
Assaf Gordon 38468e9787 tests: convert "manis" test to new framework
* testsuite/misc.pl (Tests): Add manis.
* testsuite/manis.good: Delete file.
* testsuite/manis.inp: Likewise.
* testsuite/manis.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "manis".
2017-05-10 21:37:19 -04:00
Assaf Gordon 53fc70ba89 tests: convert "linecnt" test to new framework
* testsuite/misc.pl (Tests): Add linecnt.
* testsuite/linecnt.good: Delete file.
* testsuite/linecnt.inp: Likewise.
* testsuite/linecnt.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "linecnt".
2017-05-10 21:37:19 -04:00
Assaf Gordon 00dfc24358 tests: convert "khadafy" test to new framework
* testsuite/misc.pl (Tests): Add khadafy.
* testsuite/khadafy.good: Delete file.
* testsuite/khadafy.inp: Likewise.
* testsuite/khadafy.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "khadafy".
2017-05-10 21:37:19 -04:00
Assaf Gordon 15c5f28bd2 tests: convert "inclib" test to new framework
* testsuite/misc.pl (Tests): Add inclib.
* testsuite/inclib.good: Delete file.
* testsuite/inclib.inp: Likewise.
* testsuite/inclib.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "inclib".
2017-05-10 21:37:19 -04:00
Assaf Gordon b1d6e355be tests: convert "factor" test to new framework
* testsuite/misc.pl (Tests): Add factor.
* testsuite/factor.good: Delete file.
* testsuite/factor.inp: Likewise.
* testsuite/factor.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "factor".
2017-05-10 21:37:19 -04:00
Assaf Gordon 1f4568370f tests: convert "flipcase" test to new framework
* testsuite/misc.pl (Tests): Add flipcase.
* testsuite/flipcase.good: Delete file.
* testsuite/flipcase.inp: Likewise.
* testsuite/flipcase.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "flipcase".
2017-05-10 21:37:19 -04:00
Assaf Gordon 0280fb2bc0 tests: convert "fasts" test to new framework
* testsuite/misc.pl (Tests): Add fasts.
* testsuite/fasts.good: Delete file.
* testsuite/fasts.inp: Likewise.
* testsuite/fasts.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "fasts".
2017-05-10 21:37:19 -04:00
Assaf Gordon 3942c0d210 tests: convert "enable" test to new framework
* testsuite/misc.pl (Tests): Add enable.
* testsuite/enable.good: Delete file.
* testsuite/enable.inp: Likewise.
* testsuite/enable.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "enable".
2017-05-10 21:37:19 -04:00
Assaf Gordon 6e4a0c1c4c tests: convert "cv-vars" test to new framework
* testsuite/misc.pl (Tests): Add cv-vars.
* testsuite/cv-vars.good: Delete file.
* testsuite/cv-vars.inp: Likewise.
* testsuite/cv-vars.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "cv-vars".
2017-05-10 21:37:18 -04:00
Assaf Gordon 62abe24933 tests: convert "classes" test to new framework
* testsuite/misc.pl (Tests): Add classes.
* testsuite/classes.good: Delete file.
* testsuite/classes.inp: Likewise.
* testsuite/classes.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "classes".
2017-05-10 21:37:18 -04:00
Assaf Gordon b4a5e6e968 tests: convert "bkslashes" test to new framework
* testsuite/misc.pl (Tests): Add bkslashes.
* testsuite/bkslashes.good: Delete file.
* testsuite/bkslashes.inp: Likewise.
* testsuite/bkslashes.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "bkslashes".
2017-05-10 21:37:18 -04:00
Assaf Gordon a5be8cb23c tests: convert "amp-escape" test to new framework
* testsuite/misc.pl (Tests): Add amp-escape.
* testsuite/amp-escape.good: Delete file.
* testsuite/amp-escape.inp: Likewise.
* testsuite/amp-escape.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "amp-escape".
2017-05-10 21:37:18 -04:00
Assaf Gordon 9c19138f89 tests: convert "appquit" test to new framework
* testsuite/misc.pl (Tests): Add appquit.
* testsuite/appquit.good: Delete file.
* testsuite/appquit.inp: Likewise.
* testsuite/appquit.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "appquit".
2017-05-10 21:37:18 -04:00
Assaf Gordon e925d8a5bd tests: convert "0range" test to new framework
* testsuite/misc.pl (Tests): Add 0range.
* testsuite/0range.good: Delete file.
* testsuite/0range.inp: Likewise.
* testsuite/0range.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "0range".
2017-05-10 21:37:18 -04:00
Assaf Gordon 670914a384 tests: convert "dollar" test to new framework
* testsuite/misc.pl (Tests): Add dollar.
* testsuite/dollar.good: Delete file.
* testsuite/dollar.inp: Likewise.
* testsuite/dollar.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "dollar".
2017-05-10 21:37:14 -04:00
Assaf Gordon 553f9b12fa tests: convert "xbxcx3" test to new framework
* testsuite/misc.pl (Tests): Add xbxcx3.
* testsuite/xbxcx3.good: Delete file.
* testsuite/xbxcx3.inp: Likewise.
* testsuite/xbxcx3.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "xbxcx3".
2017-05-10 21:34:09 -04:00
Assaf Gordon e0669264cd tests: convert "xabcx" test to new framework
* testsuite/misc.pl (Tests): Add xabcx.
* testsuite/xabcx.good: Delete file.
* testsuite/xabcx.inp: Likewise.
* testsuite/xabcx.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "xabcx".
2017-05-10 21:34:03 -04:00
Assaf Gordon c0a5c50492 tests: convert "xbxcx" test to new framework
* testsuite/misc.pl (Tests): Add xbxcx.
* testsuite/xbxcx.good: Delete file.
* testsuite/xbxcx.inp: Likewise.
* testsuite/xbxcx.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "xbxcx".
2017-05-10 21:33:57 -04:00
Jim Meyering 9785b2ae6b tests: convert "recall2" test to new framework
* testsuite/misc.pl (Tests): Add recall2.
* testsuite/recall2.good: Delete file.
* testsuite/recall2.inp: Likewise.
* testsuite/recall2.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "recall2".
2017-05-10 02:02:28 +00:00
Jim Meyering f64aa7873b tests: convert "recall" test to new framework
* testsuite/misc.pl (Tests): Add recall.
* testsuite/recall.good: Delete file.
* testsuite/recall.inp: Likewise.
* testsuite/recall.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "recall".
2017-05-10 02:02:28 +00:00
Jim Meyering 409ec0b60c tests: convert "insert" test to new framework
* testsuite/misc.pl (Tests): Add insert-nl.
* testsuite/insert.good: Delete file.
* testsuite/insert.inp: Likewise.
* testsuite/insert.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "insert".
2017-05-10 02:02:28 +00:00
Jim Meyering 5bd3258819 tests: convert "allsub" test to new framework
* testsuite/misc.pl (Tests): Add allsub.
* testsuite/allsub.good: Delete file.
* testsuite/allsub.inp: Likewise.
* testsuite/allsub.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "allsub".
2017-05-10 02:02:28 +00:00
Jim Meyering 5cd810a5d3 tests: convert "y-newline" test to new framework
* testsuite/misc.pl (Tests): Add y-newline.
* testsuite/y-newline.good: Delete file.
* testsuite/y-newline.inp: Likewise.
* testsuite/y-newline.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "y-newline".
2017-05-10 02:02:28 +00:00
Jim Meyering 67ac778599 tests: convert "y-zero" test to new framework
* testsuite/misc.pl (Tests): Add y-zero.
* testsuite/y-zero.good: Delete file.
* testsuite/y-zero.inp: Likewise.
* testsuite/y-zero.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "y-zero".
2017-05-10 02:02:28 +00:00
Jim Meyering 41da447bbc tests: convert "y-bracket" test to new framework
* testsuite/misc.pl (Tests): Add y-bracket.
* testsuite/y-bracket.good: Delete file.
* testsuite/y-bracket.inp: Likewise.
* testsuite/y-bracket.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "y-bracket".
2017-05-10 02:02:28 +00:00
Jim Meyering a53744ee0d tests: convert "noeol" to new framework
* testsuite/misc.pl (preserve-missing-EOL-at-EOF): New test,
replacing...
* testsuite/noeol.good: Delete file.
* testsuite/noeol.inp: Likewise.
* testsuite/noeol.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "noeol".
* testsuite/Makefile.tests (noeol): Remove target.
We also require this additional change, since the noeolw test
used the just-deleted noeol.inp input file:
* testsuite/noeolw.inp: New file, renamed from testsuite/noeol.inp.
* testsuite/Makefile.tests: Use noeolw.inp, not the other test's file.
(EXTRA_DIST): Add testsuite/noeolw.inp.
2017-05-10 02:02:28 +00:00
Jim Meyering 5f4c6d2ae4 tests: convert "insens" to new framework
* testsuite/misc.pl (case-insensitive): New test, replacing...
* testsuite/insens.good: Delete file.
* testsuite/insens.inp: Likewise.
* testsuite/insens.sed: Likewise.
* testsuite/local.mk (EXTRA_DIST): Remove their names.
(SEDTESTS): Remove "insens".
2017-05-10 02:02:28 +00:00
Jim Meyering 0eaa3cf946 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.
2017-05-10 02:02:28 +00:00
Assaf Gordon 27815344e5 tests: keep temporary directory if SAVE_TEMPS requested
When developers run 'make check SAVE_TEMPS=yes' the 'Coreutils.pm'
module does not delete the temporary files, but the CuTmpdir.pm still
deletes the temp directory. With this change, the temp directory is
kept, and printed to the log file (e.g. test-suite.log).

* testsuite/CuTmpdir.pm: if $EMV{SAVE_TEMPS} is not empty, don't
auto-delete the temp directory, and print it to the log.
2017-05-10 02:02:28 +00:00
Assaf Gordon 74dc7dca4d maint: fix wrong PATH in testsuite
The switch to non-recursive make in v4.2.2-129-g3b29bec used a wrong
directory name in the PATH construction of automake's TESTS_ENVIRONMENT
variable ('/src/' instead of '/sed').
This had no effect as each test shell script appended the ./sed/ path
independently. However, switching to perl-based tests - this will be
noticed as the just-built sed binary will not be in the PATH.

* testsuite/local.mk: Fix $PATH variable in test environment.
2017-05-10 02:02:28 +00:00
Jim Meyering 0141cf8288 maint: ignore more
* .gitignore: Ignore a bunch of doc/*.* texinfo artifacts and sort.
2017-04-22 13:23:03 -04:00
Jim Meyering 031fa38f4e tests: support perl-based tests like those of grep and coreutils
* configure.ac: Define HAVE_PERL.
* testsuite/Coreutils.pm: New file. From grep.
* testsuite/CuSkip.pm: Likewise.
* testsuite/CuTmpdir.pm: Likewise.
* testsuite/local.mk (, TEST_EXTENSIONS): Add .pl.
(TESTSUITE_PERL, TESTSUITE_PERL_OPTIONS): Define.
(PL_LOG_COMPILER): Define.
(EXTRA_DIST): Add the new .pm files.
2017-04-22 13:23:03 -04:00
Assaf Gordon 11a2a701ec sed: enable special meaning of '+' with '-E --posix'
in sed-4.2 and later, '--posix' option wrongly disabled the special meaning
of '+' even in ERE mode (--posix should only disable it in BRE mode,
since it is a GNU extension in BRE). Bug introduced in the original
implementation of --posix in v4.1a-5-gba68fb4.
Reported by Jordan Torbiak in https://bugs.gnu.org/26409 .

* NEWS: Mention bug fix.
* sed/regexp.c (compile_regex_1): In --posix mode, set RE_LIMITED_OPS
only in BRE mode.
* testsuite/posix-mode-ERE.sh: New test.
* testsuite/local.mk: Add new test.
2017-04-18 20:47:41 -04:00
Assaf Gordon 156e6be99f tests: test comments, braces after commands
Test multiple combinations of comments, spaces, braces after commands,
to validate recently added function 'read_end_of_cmd()'.
See discussion in https://bugs.gnu.org/22460 .

* testsuite/command-endings.sh: New test, including y/// bug.
* testsuite/local.mk: Add new test.
2017-03-21 22:33:39 -04:00
Assaf Gordon 9b26a0651a sed: refactor end-of-line parsing
Follow-up to bug#22460: extract repeated code to parse end of lines
(while saving comments, braces) into a new function.
See discussion in https://bugs.gnu.org/22460 .

* sec/compile.c (read_end_of_cmd): New function, consumes sed script
input until newline, EOF, semicolon, closing brace or comment is found.
(compile_program): Call new function instead of duplicating code.
2017-03-21 22:30:17 -04:00
Thorsten Heymann cf8eb6cb39 sed: allow comments, braces after y///
sed-4.4 and earlier rejected the following:
  $ sed 'y/1/a/ #f'
  sed: -e expression #1, char 8: extra characters after command

See https://bugs.gnu.org/22460 .

* sed/compile.c (compile_program): Handle comments, braces after 'y' command.
* NEWS: Mention it.
2017-03-21 22:14:29 -04:00
Kent Fredric b092d4a6c0 tests: ensure tty device is readable before running test
Unreadable tty's fail with a different permissions error
instead of failing with "is a tty" error.
Reported in https://bugs.gnu.org/25692 .

* testsuite/panic-tests.sh: Run test if tty device is both readable
and writable.

Copyright-paperwork-exempt: Yes
2017-03-19 22:28:42 -04:00
Assaf Gordon 05800ee0b7 doc: expand "locale considerations" (multibyte) section
Show examples of processing valid and invalid characters.
Mention \L,\U for s/// command.
Combines reports from:
 https://bugs.debian.org/500501
 https://lists.gnu.org/archive/html/coreutils/2017-02/msg00039.html

* doc/sed.texi (Locale Consideration): Expand section.
* doc/config.texi: Add variables to render unicode characters portably.
2017-03-08 01:06:01 +00:00
Assaf Gordon a36e8abccc doc: warn against misuse of -i with other options
'sed -iE' is not the same as 'sed -Ei'. 'sed -ni' is dangerous.
From https://bugs.debian.org/832088

* doc/sed.texi (Command-Line Options): Explain and add examples
to '-i/--in-place' item.
2017-02-24 01:18:28 -05:00
Assaf Gordon de6b6ccd74 doc: elaborate about regex matching on pattern space
Regex addresses work on current pattern space, not on the original
input lines. From https://bugs.debian.org/284646

* doc/sed.texi (Regexp Addresses): Add a paragraph and an example.
* doc/sed.x (Addresses): Add a sentence about regexp.
2017-02-24 00:49:20 -05:00
Assaf Gordon a805d57e1f doc: mention escape-sequence precedence
Unescaping takes place before passing the pattern to the regex engine:
    $ echo 'a^c' | sed -e 's/\x5e/b/'
    ba^c

From: https://bugs.debian.org/605142

* doc/sed.texi (Escaping Precedence): Add new subsection under 'escape
sequences' with examples.
2017-02-24 00:22:51 -05:00
Assaf Gordon 75e5a9b686 build: fix 'install-html' target
Switching to non-recursive makefiles broke the 'install-html' target:
The gettext plumbing requires an 'install-html' target in po/Makefile.
This was fixed in gettext v0.19.8.1-41-ge5a008a, but packages using
older gettext need to manually patch po/Makefile.in.in.
Report and suggested fix by Eric Blake in https://debbugs.gnu.org/25690 .

* bootstrap.conf (bootstrap_epilogue): Add 'install-{html,pdf,dvi,ps}'
  targets to po/Makefile.in.in (if needed).
2017-02-16 21:07:21 -05:00
Alexandre Jasmin 1c6030213b doc: reference the i command in /regexp/I
Remove "TODO: add @code{pxref}" in the text and add the ref.

* doc/sed.texi (selecting lines by text matching): Add reference.
2017-02-09 23:00:35 -05:00
Alexandre Jasmin 45aae495cb doc: rework BRE/ERE table to fit PDF manual
Sample code in the basic/extended table was too wide to fit on a Letter
size printout. Text was overlapping and unreadable. Remove margin,
split commands in two lines and change the column with.

* doc/sed.texi (Basic and extended regexp): Rework table.
2017-02-09 23:00:35 -05:00
Alexandre Jasmin 5fbc15c812 doc: change description of the r command
"Reads text file a file" was probably a typo. Also remove "Example: " in
the summary as there's no example there.

* doc/sed.texi (sed scripts): Fix r command description.

Copyright-paperwork-exempt: Yes
2017-02-07 09:29:48 +00:00
Alexandre Jasmin 755e9434c0 doc: fix copy-pasted examples of regexp
The samples commands demonstrating '\B' and '\S' were both using '\w'.
The commands output is correct.

* doc/sed.texi (Regular Expression Extensions): Use the proper commands.

Copyright-paperwork-exempt: Yes
2017-02-07 09:28:04 +00:00
Jim Meyering fe3f8af814 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2017-02-03 17:17:45 -08:00