3 # Copyright 2020 by Denys Vlasenko <vda.linux@googlemail.com>
4 # Licensed under GPLv2, see file LICENSE in this source tree.
8 # testing "description" "command" "result" "infile" "stdin"
9 testing
'xxd -p with one NUL' \
17 testing
'xxd -p with 30 NULs' \
20 000000000000000000000000000000000000000000000000000000000000
23 '\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'
25 testing
'xxd -p with 31 NULs' \
28 000000000000000000000000000000000000000000000000000000000000
32 '\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'
36 '01234567765432100123456776543210' \
38 '30313233343536373736353433323130 30313233343536373736353433323130'
40 testing
'xxd -r skips leading whitespace and truncates at two spaces' \
44 00000000: 3031 3233 3435 3637 3839 3a3b 3c3d 3e3f 0123456789:;<=>?
48 testing
'xxd -p -r skips one bad char, truncates at two bad chars' \
55 testing
'xxd -p -r ignores the nibble with 2nd char bad' \