aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2010-01-21 18:58:03 -0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-22 04:20:16 +0100
commit6f99c91e431a5afb90ac6d041ea9b08d39c965eb (patch)
treeb31cfab949982043ce993ec240731d2ca4cbc8a4 /testsuite
parentfeadfe742ae9cdc8ddeb425e2b7808c2905bfccb (diff)
downloadbusybox-w32-6f99c91e431a5afb90ac6d041ea9b08d39c965eb.tar.gz
busybox-w32-6f99c91e431a5afb90ac6d041ea9b08d39c965eb.tar.bz2
busybox-w32-6f99c91e431a5afb90ac6d041ea9b08d39c965eb.zip
diff: fix flag -B, cleanups and a couple more tests V2
function old new delta diffreg 1157 1268 +111 uni_range 51 - -51 Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/diff.tests31
1 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/diff.tests b/testsuite/diff.tests
index f7bde2f5b..72ebb6c4c 100755
--- a/testsuite/diff.tests
+++ b/testsuite/diff.tests
@@ -44,6 +44,17 @@ testing "diff of stdin, twice" \
44 "" \ 44 "" \
45 "stdin" 45 "stdin"
46 46
47testing "diff of empty file against nonempty one" \
48 "diff -u - input | $TRIM_TAB" \
49"\
50--- -
51+++ input
52@@ -0,0 +1 @@
53+a
54" \
55 "a\n" \
56 ""
57
47testing "diff -b treats EOF as whitespace" \ 58testing "diff -b treats EOF as whitespace" \
48 'diff -ub - input; echo $?' \ 59 'diff -ub - input; echo $?' \
49 "0\n" \ 60 "0\n" \
@@ -56,6 +67,26 @@ testing "diff -b treats all spaces as equal" \
56 "a \t c\n" \ 67 "a \t c\n" \
57 "a\t \tc\n" 68 "a\t \tc\n"
58 69
70testing "diff -B ignores changes whose lines are all blank" \
71 'diff -uB - input; echo $?' \
72 "0\n" \
73 "a\n" \
74 "\na\n\n"
75
76testing "diff -B does not ignore changes whose lines are not all blank" \
77 "diff -uB - input | $TRIM_TAB" \
78"\
79--- -
80+++ input
81@@ -1,3 +1 @@
82-
83-b
84-
85+a
86" \
87 "a\n" \
88 "\nb\n\n"
89
59testing "diff always takes context from old file" \ 90testing "diff always takes context from old file" \
60 "diff -ub - input | $TRIM_TAB" \ 91 "diff -ub - input | $TRIM_TAB" \
61"\ 92"\