19 Commits

Author SHA1 Message Date
Quentin Casasnovas
c80b1a06a9 test-lib.sh: factorize require_* functions
Since the code is identical when just checking if a utility is present on
the system or not, we can factorize it.

Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
2015-01-31 22:14:01 +01:00
Jim Meyering
2d38b11799 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:26:02 +01:00
Jim Meyering
db2fb7cdba maint: update copyright date year ranges to include 2011
* bootstrap.conf (gnulib_modules): Add update-copyright.
Run "make update-copyright".
2011-03-27 09:16:46 +02:00
Jim Meyering
2876ed918f maint: avoid non-portable use of test -a
With these changes, "make sc_prohibit_test_minus_ao" almost passes.
Uses of "test -o" remain.
Note: unchecked uses of test -ot/-nt also remain.
* tests/empty-files: Use "test C1 && test C2", not "test C1 -a C2"
* tests/merge: Likewise.
* tests/symlinks: Likewise.
* tests/test-lib.sh: Likewise.
2011-03-26 14:20:28 +01:00
Andreas Gruenbacher
99d75edf46 More test suite fixes
* tests/create-delete: Do not use 'diff' here.
* tests/merge: Require GNU diff.
2010-05-05 12:18:41 +02:00
Andreas Gruenbacher
dbb26b7e99 Some test suite fixes and improvements
* tests/test-lib.sh: Flag tests with missing pre-requirements as
SKIPped instead of PASSed.  Do not use GNU diff extensions, but
still require a diff that understands "-u".
* tests: Do not unnecessarily require GNU diff in a lot of tests.
Make the sed utility optional.
2010-05-04 04:07:45 +02:00
Andreas Gruenbacher
b1c58bd212 Portability fixes in the test suite
* tests/merge: Use the sed commands i, a, and c in their standard form
instead of relying on a GNU extension, and pass sed a script (-f)
instead of a list of commands via -e.
Some versions of sed don't support expressions like /^\(\|foo\)$/.
* tests/corrupt-reject-files: Use the more widely available -e switch
instead of -A.
* tests/crlf-handling: Likewise.
* tests/preserve-mode-and-timestamp: Use touch -t instead of touch -d.
Some non-GNU versions of date can't show a file's timestamp.
2010-04-15 16:24:09 +02:00
Andreas Gruenbacher
d300ec9bb8 Merge: detect already-applied inserts at the end of files
* src/merge.c: When a hunk has fewer suffix than prefix context lines,
try matching to the end of the file instead of doing a "greedy match":
this allows to detect already-applied inserts at the end of the file.
* tests/merge: Add test cases for this.
2010-02-21 00:37:40 +01:00
Andreas Gruenbacher
8cc8b7061c * src/patch.c (longopts, get_some_switches): Add an optional argument
to the --merge option to choose the output formats for conflicts.
* patch.man: Document the new optional argument of --merge.
* src/merge.c (merge_hunk): Implement diff3-style conflicts.
* src/common.h (conflict_style): This global variable determines the
output format for conflicts.
* tests/merge: Add test cases for the diff3 output format.
2009-12-29 17:03:14 +01:00
Andreas Gruenbacher
87f54e80e1 Clarify the message when (part of) a hunk cannot be merged 2009-10-27 16:46:25 +01:00
Andreas Gruenbacher
62d03acb14 The -m option hasn't been officially allocated yet; use only the long form for now (--merge) 2009-07-19 17:50:54 +02:00
Andreas Gruenbacher
ccba56be0c Make the ed utility optional in the test suite 2009-04-03 18:53:13 +02:00
Andreas Gruenbacher
b45358fa11 Another minor merge message improvement 2009-04-03 15:58:39 +02:00
Andreas Gruenbacher
9e15efdd5e Slightly improved merge result reporting 2009-04-03 15:40:11 +02:00
Andreas Gruenbacher
dd8abc0b38 Fix two failed assertions in merge_hunk() 2009-04-02 16:00:58 +02:00
Andreas Gruenbacher
8d7f4cc344 The maximum position for a merge was computed too low 2009-04-02 14:36:28 +02:00
Andreas Gruenbacher
276afe5ec2 Add better merge support 2009-04-02 06:42:48 +02:00
Andreas Gruenbacher
e81ef4feae Locate hunks to merge more intelligently 2009-04-02 06:33:57 +02:00
Andreas Gruenbacher
b709d77ca8 Add a simple form of merge support 2009-04-02 06:25:22 +02:00