blob: 42122a4dfc4c2f9839c3b07a366ef57417799f56 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
#!/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 -n2k" \
'cmp -n2k - input; echo $?' \
"- input differ: byte 1, line 1
1
" \
"foo" \
"bar"
testing "cmp -n 1g" \
'cmp -n 1g - 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"
testing "cmp -ln2M" \
'cmp -ln2M - input; echo $?' \
"\
1 142 146
2 141 157
3 162 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
|