From dac5b8314236338963877903cba3d7edfbfc9c58 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 20 Oct 2020 18:54:36 +0200 Subject: xxd: fix printing of trailing spaces function old new delta bb_dump_dump 1497 1523 +26 xxd_main 459 466 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 33/0) Total: 33 bytes Signed-off-by: Denys Vlasenko --- testsuite/xxd.tests | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 testsuite/xxd.tests (limited to 'testsuite') diff --git a/testsuite/xxd.tests b/testsuite/xxd.tests new file mode 100755 index 000000000..2e80be5fe --- /dev/null +++ b/testsuite/xxd.tests @@ -0,0 +1,34 @@ +#!/bin/sh + +# Copyright 2020 by Denys Vlasenko +# 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 -- cgit v1.2.3