summaryrefslogtreecommitdiffhomepage
path: root/testsuite/hexdump.tests
blob: cfb20187e412a69a2e40a423cf6fc7ce9b05b6ed (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
#!/bin/sh

# Copyright 2018 by Denys Vlasenko <vda.linux@googlemail.com>
# Licensed under GPLv2, see file LICENSE in this source tree.

. ./testing.sh

# testing "description" "command" "result" "infile" "stdin"
testing 'hexdump -C with four NULs' \
	'hexdump -C' \
	"\
00000000  00 00 00 00                                       |....|
00000004
" \
	'' \
	'\0\0\0\0'

testing "hexdump does not think last padded block matches any full block" \
	"hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
	"\
00|00!
*
00|  !
" \
	'' \
	'\0\0\0\0\0\0\0\0\0\0\0'

testing "hexdump thinks last full block can match" \
	"hexdump -e '1/1 \"%02x|\"1/1 \"%02x!\\n\"'" \
	"\
00|00!
*
" \
	'' \
	'\0\0\0\0\0\0\0\0\0\0\0\0'

exit $FAILCOUNT