blob: cfb20187e412a69a2e40a423cf6fc7ce9b05b6ed [file] [log] [blame]
Denys Vlasenkoe5d5f5b2018-07-03 16:27:54 +02001#!/bin/sh
2
3# Copyright 2018 by Denys Vlasenko <vda.linux@googlemail.com>
4# Licensed under GPLv2, see file LICENSE in this source tree.
5
6. ./testing.sh
7
8# testing "description" "command" "result" "infile" "stdin"
9testing 'hexdump -C with four NULs' \
10 'hexdump -C' \
11 "\
1200000000 00 00 00 00 |....|
1300000004
14" \
15 '' \
16 '\0\0\0\0'
17
Denys Vlasenko079487b2020-10-20 19:26:52 +020018testing "hexdump does not think last padded block matches any full block" \
19 "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
20 "\
2100|00!
22*
2300| !
24" \
25 '' \
26 '\0\0\0\0\0\0\0\0\0\0\0'
27
28testing "hexdump thinks last full block can match" \
29 "hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
30 "\
3100|00!
32*
33" \
34 '' \
35 '\0\0\0\0\0\0\0\0\0\0\0\0'
36
Denys Vlasenkoe5d5f5b2018-07-03 16:27:54 +020037exit $FAILCOUNT