Fluff up cmp tests.
This commit is contained in:
parent
8361fbd8ea
commit
19394faadb
@ -22,12 +22,14 @@ testing "EOF, return code" "cmp input input2 2>/dev/null || echo yes" "yes\n" "a
|
|||||||
testing "diff, stdout" "cmp input input2" "input input2 differ: char 4, line 2\n" "ab\nx\nx" ""
|
testing "diff, stdout" "cmp input input2" "input input2 differ: char 4, line 2\n" "ab\nx\nx" ""
|
||||||
testing "diff, return code" "cmp input input2 > /dev/null || echo yes" "yes\n" "ab\nx\nx" ""
|
testing "diff, return code" "cmp input input2 > /dev/null || echo yes" "yes\n" "ab\nx\nx" ""
|
||||||
|
|
||||||
testing "-s EOF, return code" "cmp -s input input2 || echo yes" "yes\n" "ab\nc\nx" ""
|
testing "-s EOF, return code" "cmp -s input input2 2>&1 || echo yes" "yes\n" "ab\nc\nx" ""
|
||||||
testing "-s diff, return code" "cmp -s input input2 || echo yes" "yes\n" "ab\nx\nx" ""
|
testing "-s diff, return code" "cmp -s input input2 2>&1 || echo yes" "yes\n" "ab\nx\nx" ""
|
||||||
|
|
||||||
testing "-l EOF, stderr" "cmp -l input input2 2>&1" "cmp: EOF on input2\n" "ab\nc\nx" ""
|
testing "-l EOF, stderr" "cmp -l input input2 2>&1" "cmp: EOF on input2\n" "ab\nc\nx" ""
|
||||||
testing "-l diff and EOF, stdout and stderr" "cmp -l input input2 2>&1 | sort" "4 170 143\ncmp: EOF on input2\n" "ab\nx\nx" ""
|
testing "-l diff and EOF, stdout and stderr" "cmp -l input input2 2>&1 | sort" "4 170 143\ncmp: EOF on input2\n" "ab\nx\nx" ""
|
||||||
|
|
||||||
|
testing "-s not exist" "cmp -s input doesnotexist 2>&1 || echo yes" "yes\n" "" ""
|
||||||
|
|
||||||
rm input2
|
rm input2
|
||||||
|
|
||||||
testing "stdin and file" "cmp input -" "input - differ: char 4, line 2\n" "ab\nc\n" "ab\nx\n"
|
testing "stdin and file" "cmp input -" "input - differ: char 4, line 2\n" "ab\nc\n" "ab\nx\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user