2 # Copyright 2008 by Denys Vlasenko
3 # Licensed under GPL v2, see file LICENSE for details.
7 # testing "test name" "options" "expected result" "file input" "stdin"
9 # diff outputs date/time in the header, which should not be analysed
10 # NB: sed has tab character in s command!
11 TRIM_TAB="sed 's/ .*//'"
13 testing "diff of stdin" \
14 "diff -u - input | $TRIM_TAB" \
26 testing "diff of stdin, no newline in the file" \
27 "diff -u - input | $TRIM_TAB" \
35 \\ No newline at end of file
40 # we also test that stdin is in fact NOT read
41 testing "diff of stdin, twice" \
42 "diff - -; echo $?; wc -c" \
47 # testing "test name" "options" "expected result" "file input" "stdin"
50 mkdir diff1 diff2 diff2/subdir
52 echo asd >diff2/subdir/-
53 testing "diff diff1 diff2/subdir" \
54 "diff -ur diff1 diff2/subdir | $TRIM_TAB" \
64 # using directory structure from prev test...
65 testing "diff dir dir2/file/-" \
66 "diff -ur diff1 diff2/subdir/- | $TRIM_TAB" \
76 # using directory structure from prev test...
78 mkfifo diff2/subdir/test
79 testing "diff of dir and fifo" \
80 "diff -ur diff1 diff2/subdir | $TRIM_TAB" \
87 Only in diff2/subdir: test
91 # using directory structure from prev test...
94 testing "diff of file and fifo" \
95 "diff -ur diff1 diff2/subdir | $TRIM_TAB" \
102 File diff2/subdir/test is not a regular file or directory and was skipped
106 # using directory structure from prev test...
108 testing "diff -rN does not read non-regular files" \
109 "diff -urN diff1 diff2/subdir | $TRIM_TAB" \
116 File diff2/subdir/test is not a regular file or directory and was skipped
117 File diff1/test2 is not a regular file or directory and was skipped