mirror of
https://git.busybox.net/busybox
synced 2026-02-15 22:16:09 +00:00
function old new delta packed_usage 35802 35828 +26 cmp_main 616 595 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 26/-21) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
54 lines
723 B
Bash
Executable file
54 lines
723 B
Bash
Executable file
#!/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
|