diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-18 01:04:20 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-18 01:04:20 +0100 |
commit | b972f949577301bd7a66e88c11b9e26431d80a11 (patch) | |
tree | 753f4fffca651075a72774495700b882cf56c42d | |
parent | 33f9dc08e55b8938452fce20e7c5e4138255edc9 (diff) | |
download | busybox-w32-b972f949577301bd7a66e88c11b9e26431d80a11.tar.gz busybox-w32-b972f949577301bd7a66e88c11b9e26431d80a11.tar.bz2 busybox-w32-b972f949577301bd7a66e88c11b9e26431d80a11.zip |
diff: add more tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-x | testsuite/diff.tests | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/testsuite/diff.tests b/testsuite/diff.tests index bf24b7752..06bf163d0 100755 --- a/testsuite/diff.tests +++ b/testsuite/diff.tests | |||
@@ -39,11 +39,39 @@ testing "diff of stdin, no newline in the file" \ | |||
39 | 39 | ||
40 | # we also test that stdin is in fact NOT read | 40 | # we also test that stdin is in fact NOT read |
41 | testing "diff of stdin, twice" \ | 41 | testing "diff of stdin, twice" \ |
42 | "diff - -; echo $?; wc -c" \ | 42 | 'diff - -; echo $?; wc -c' \ |
43 | "0\n5\n" \ | 43 | "0\n5\n" \ |
44 | "" \ | 44 | "" \ |
45 | "stdin" | 45 | "stdin" |
46 | 46 | ||
47 | test x"$SKIP_KNOWN_BUGS" = x"" && \ | ||
48 | testing "diff -b treats EOF as whitespace" \ | ||
49 | 'diff -ub - input; echo $?' \ | ||
50 | "0\n" \ | ||
51 | "abc" \ | ||
52 | "abc " | ||
53 | |||
54 | test x"$SKIP_KNOWN_BUGS" = x"" && \ | ||
55 | testing "diff -b treats all spaces as equal" \ | ||
56 | 'diff -ub - input; echo $?' \ | ||
57 | "0\n" \ | ||
58 | "a \t c\n" \ | ||
59 | "a\t \tc\n" | ||
60 | |||
61 | test x"$SKIP_KNOWN_BUGS" = x"" && \ | ||
62 | testing "diff always takes context from old file" \ | ||
63 | "diff -ub - input | $TRIM_TAB" \ | ||
64 | "\ | ||
65 | --- - | ||
66 | +++ input | ||
67 | @@ -1 +1,3 @@ | ||
68 | +abc | ||
69 | a c | ||
70 | +def | ||
71 | " \ | ||
72 | "abc\na c\ndef\n" \ | ||
73 | "a c\n" | ||
74 | |||
47 | # testing "test name" "options" "expected result" "file input" "stdin" | 75 | # testing "test name" "options" "expected result" "file input" "stdin" |
48 | 76 | ||
49 | rm -rf diff1 diff2 | 77 | rm -rf diff1 diff2 |