mirror of
https://github.com/sheumann/hush.git
synced 2024-11-17 10:07:19 +00:00
diff: add more tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
33f9dc08e5
commit
b972f94957
@ -39,11 +39,39 @@ testing "diff of stdin, no newline in the file" \
|
||||
|
||||
# we also test that stdin is in fact NOT read
|
||||
testing "diff of stdin, twice" \
|
||||
"diff - -; echo $?; wc -c" \
|
||||
'diff - -; echo $?; wc -c' \
|
||||
"0\n5\n" \
|
||||
"" \
|
||||
"stdin"
|
||||
|
||||
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
||||
testing "diff -b treats EOF as whitespace" \
|
||||
'diff -ub - input; echo $?' \
|
||||
"0\n" \
|
||||
"abc" \
|
||||
"abc "
|
||||
|
||||
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
||||
testing "diff -b treats all spaces as equal" \
|
||||
'diff -ub - input; echo $?' \
|
||||
"0\n" \
|
||||
"a \t c\n" \
|
||||
"a\t \tc\n"
|
||||
|
||||
test x"$SKIP_KNOWN_BUGS" = x"" && \
|
||||
testing "diff always takes context from old file" \
|
||||
"diff -ub - input | $TRIM_TAB" \
|
||||
"\
|
||||
--- -
|
||||
+++ input
|
||||
@@ -1 +1,3 @@
|
||||
+abc
|
||||
a c
|
||||
+def
|
||||
" \
|
||||
"abc\na c\ndef\n" \
|
||||
"a c\n"
|
||||
|
||||
# testing "test name" "options" "expected result" "file input" "stdin"
|
||||
|
||||
rm -rf diff1 diff2
|
||||
|
Loading…
Reference in New Issue
Block a user