8 Commits

Author SHA1 Message Date
Jim Meyering
a9cc55101c tests: use "returns_" rather than explicit comparison with "$?"
* tests/colors: Use "returns_ 1" rather than testing $? = 1
* tests/basic: Likewise.
* tests/binary: Likewise.
* tests/filename-quoting: Likewise.
* tests/function-line-vs-leading-space: Likewise.
* tests/ignore-matching-lines: Likewise.
* tests/label-vs-func: Likewise.
* tests/new-file: Likewise.
* tests/no-dereference: Likewise.
* tests/no-newline-at-eof: Likewise.
* tests/stdin: Likewise.
2016-11-08 18:28:04 -08:00
Paul Eggert
d2fd9d4683 diff: fix bug with diff -B and incomplete lines
Reported by Navin Kabra via Eric Blake in:
http://bugs.gnu.org/18402
* src/util.c (analyze_hunk): Don't mishandle incomplete
lines at end of file.
* tests/no-newline-at-eof: Test for the bug.
2014-09-03 15:59:24 -07:00
Jim Meyering
31b43733d4 tests: use "compare exp out", not "compare out exp"
Likewise, when an empty file is expected, use "compare /dev/null out",
not "compare out /dev/null". I.e., specify the expected/desired contents
via the first file name.  Prompted by a suggestion from Bruno Haible
in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154

Run these commands:

  git grep -l -E 'compare [^ ]+ exp' \
    |xargs perl -pi -e 's/\b(compare) (\S+) (exp\S*)/$1 $3 $2/'
  git grep -l -E 'compare [^ ]+ /dev/null' \
    |xargs perl -pi -e 's,\b(compare) (\S+) (/dev/null),$1 $3 $2,'

But manually convert this one:

  -compare out exp-$(echo $opt|tr ' ' _)
  +compare exp-$(echo $opt|tr ' ' _) out

and avoid an inappropriate change to cfg.mk.
2011-11-29 17:17:10 +01:00
Stefano Lattarini
366adeb73d tests: make test runner a script, not a shell function
All the test scripts in the diffutils testsuite are shell scripts,
so the current definition of TESTS_ENVIRONMENT, which adaptively
run tests using either perl or the shell depending on their kind,
is an overkill.

Moreover, this change is required in order for the testsuite to
continue to work with the new testsuite harness that is planned
to be introduced in Automake 1.12 (which, as of the writing date,
is still under development and in late alpha state).

See also related discussion on bug-coreutils:
 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8887>

* tests/Makefile.am (TESTS_ENVIRONMENT): Remove definition of the
`shell_or_perl_' shell function, which is not required anymore.
(LOG_COMPILER): New, define to `$(SHELL)'.
* tests/binary: Make executable.
* tests/colliding-file-names: Likewise.
* tests/excess-slash: Likewise.
* tests/no-newline-at-eof: Likewise.
2011-10-11 16:40:12 +02:00
Jim Meyering
361b3b13da maint: adjust init.sh use to conform
* tests/help-version: Use one line: "${srcdir=.}/init.sh"; ...
* tests/basic: Likewise.
* tests/binary: Likewise.
* tests/colliding-file-names: Likewise.
* tests/excess-slash: Likewise.
* tests/function-line-vs-leading-space: Likewise.
* tests/help-version: Likewise.
* tests/label-vs-func: Likewise.
* tests/no-newline-at-eof: Likewise.
* tests/stdin: Likewise.
2010-09-04 09:15:32 +02:00
Jim Meyering
59669066e7 tests: use original no-newline-at-eof test, but with -U1, not -U2
* tests/no-newline-at-eof: Revert to the smaller test, but with
-U1 rather than -U2, since that actually triggers the bug.
2010-04-17 08:29:36 +02:00
Paul Eggert
4ba438168d Followon improvements for the fix for Debian bug 577832.
* src/io.c (find_and_hash_each_line): Omit the inserted newline in
a simpler way.
* tests/no-newline-at-eof: Fix the test case so that it rejects
the old, buggy behavior.
2010-04-16 22:20:04 -07:00
Jim Meyering
6bb3d29008 tests: test for the no-newline-at-EOF bug
* tests/no-newline-at-eof: New file.
* tests/Makefile.am (TESTS): Add it.
2010-04-16 11:28:46 +02:00