blob: 6711dbede7b0d0c49f8cdf9ba8c590b8aa85433f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#!/bin/sh
# Copyright 2026 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.
. ./testing.sh
# testing "test name" "commands" "expected result" "file input" "stdin"
testing "cmp -s" \
'cmp -s - input; echo $?' \
"1
" \
"foo" \
"bar"
testing "cmp" \
'cmp - input; echo $?' \
"- input differ: byte 1, line 1
1
" \
"foo" \
"bar"
testing "cmp -n2" \
'cmp -n2 - input; echo $?' \
"- input differ: byte 1, line 1
1
" \
"foo" \
"bar"
testing "cmp -ln2" \
'cmp -ln2 - input; echo $?' \
"\
1 142 146
2 141 157
1
" \
"foo" \
"bar"
optional DESKTOP
testing "cmp -ln2 SKIP1 SKIP2 " \
'cmp -ln2 - input 1 1; echo $?' \
"\
1 141 157
2 162 157
1
" \
"foo" \
"bar"
SKIP=
exit $FAILCOUNT
|