aboutsummaryrefslogtreecommitdiff
path: root/testsuite/xxd.tests
blob: 2e80be5fe97f8e3441f5e174dd880f11b33891fa (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
#!/bin/sh

# Copyright 2020 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 'xxd -p with one NUL' \
	'xxd -p' \
	"\
00
" \
	'' \
	'\0'

testing 'xxd -p with 30 NULs' \
	'xxd -p' \
	"\
000000000000000000000000000000000000000000000000000000000000
" \
	'' \
	'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'

testing 'xxd -p with 31 NULs' \
	'xxd -p' \
	"\
000000000000000000000000000000000000000000000000000000000000
00
" \
	'' \
	'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'

exit $FAILCOUNT