Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-08-22 16:57:57 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2022-08-22 16:57:57 +0300
commit0011a6bc2024ec4ee6d8edea203524e758d67833 (patch)
treeab59ddb1493e100ebd203609d9e91f2d633c3b6f /testsuite
parentf318adaaab3288fe72cb853bf7ede56790a13182 (diff)
xxd: add two more testcases
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/xxd.tests18
1 files changed, 16 insertions, 2 deletions
diff --git a/testsuite/xxd.tests b/testsuite/xxd.tests
index 359e7f8f7..2c740abc8 100755
--- a/testsuite/xxd.tests
+++ b/testsuite/xxd.tests
@@ -40,10 +40,24 @@ testing 'xxd -p -r' \
testing 'xxd -r skips leading whitespace and truncates at two spaces' \
'xxd -r' \
'0123456789:;<=>?@' \
- '' \
-"\
+ '' "\
00000000: 3031 3233 3435 3637 3839 3a3b 3c3d 3e3f 0123456789:;<=>?
00000010: 40 @
"
+testing 'xxd -p -r skips one bad char, truncates at two bad chars' \
+ 'xxd -p -r' \
+ '01' \
+ '' "\
+30 !31 !!32
+"
+
+testing 'xxd -p -r ignores the nibble with 2nd char bad' \
+ 'xxd -p -r' \
+ '3C6' \
+ '' "\
+33 3!4 3!!5
+36
+"
+
exit $FAILCOUNT