~ubuntu-branches/ubuntu/lucid/patch/lucid

« back to all changes in this revision

Viewing changes to tests/asymmetric-hunks

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg
  • Date: 2009-12-02 10:25:26 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20091202102526-5luk0zsqhghu58l2
Tags: 2.6-2
* Update watch file.
* Section: vcs.
* Suggests: diffutils-doc instead of diff-doc, thanks Christoph Anton
  Mitterer for spotting. Closes: #558974.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2009 Free Software Foundation, Inc.
 
2
#
 
3
# Copying and distribution of this file, with or without modification,
 
4
# in any medium, are permitted without royalty provided the copyright
 
5
# notice and this notice are preserved.
 
6
 
 
7
. $srcdir/test-lib.sh
 
8
 
 
9
require_cat
 
10
require_diff
 
11
use_local_patch
 
12
use_tmpdir
 
13
 
 
14
# ==============================================================
 
15
 
 
16
# Starts at a line <= 1 and prefix context < suffix context: start of
 
17
# file until hunk has become symmetric.
 
18
 
 
19
cat > a.diff <<EOF
 
20
--- a
 
21
+++ a
 
22
@@ -1,3 +1,4 @@
 
23
 2
 
24
+2a
 
25
 3
 
26
 4
 
27
EOF
 
28
 
 
29
seq 1 5 > a
 
30
 
 
31
check 'patch < a.diff' <<EOF
 
32
patching file a
 
33
Hunk #1 succeeded at 2 with fuzz 1 (offset 1 line).
 
34
EOF
 
35
 
 
36
seq 2 5 > a
 
37
 
 
38
check 'patch < a.diff' <<EOF
 
39
patching file a
 
40
EOF
 
41
 
 
42
# ==============================================================
 
43
 
 
44
# Starts at a line > 1: anywhere in the file
 
45
 
 
46
cat > a.diff <<EOF
 
47
--- a
 
48
+++ a
 
49
@@ -2,3 +2,4 @@
 
50
 2
 
51
+2a
 
52
 3
 
53
 4
 
54
EOF
 
55
 
 
56
seq 1 5 > a
 
57
 
 
58
check 'patch < a.diff' <<EOF
 
59
patching file a
 
60
EOF
 
61
 
 
62
# ==============================================================
 
63
 
 
64
# Prefix context > suffix context: end of file until hunk has
 
65
# become symmetric.
 
66
 
 
67
cat > a.diff <<EOF
 
68
--- a
 
69
+++ a
 
70
@@ -2,3 +2,4 @@
 
71
 2
 
72
 3
 
73
+3a
 
74
 4
 
75
EOF
 
76
 
 
77
seq 1 5 > a
 
78
 
 
79
check 'patch < a.diff' <<EOF
 
80
patching file a
 
81
Hunk #1 succeeded at 2 with fuzz 1.
 
82
EOF