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>2023-05-25 18:39:28 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-05-25 18:40:20 +0300
commite2287f99fe6f21fd6435ad04340170ad4ba5f6b3 (patch)
tree09224d93a16e18c0f4e31ada2375d7ca9cfab03e /testsuite
parent64bdd7566c21cb53cb4c384ed52845106529e55f (diff)
od: for !DESKTOP, match output more closely to GNU coreutils 9.1, implement -s
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/od.tests83
1 files changed, 44 insertions, 39 deletions
diff --git a/testsuite/od.tests b/testsuite/od.tests
index 0b949d5f0..500e0e638 100755
--- a/testsuite/od.tests
+++ b/testsuite/od.tests
@@ -9,14 +9,19 @@
input="$(printf '\001\002\003\nABC\xfe')"
le=false
-{ printf '\0\1' | od -i | grep -q 256; } && le=true
+{ printf '\0\1' | od -s | grep -q 256; } && le=true
readonly le
+# NB:
+# sed 's/ *$//' truncates trailing spaces.
+# This needs to be fixed properly (not output them).
+# For now, the tests ignore them (does not require a match).
+
optional !DESKTOP
testing "od -a (!DESKTOP)" \
- "od -a" \
+ "od -a | sed 's/ *$//'" \
"\
-0000000 soh stx etx lf A B C fe
+0000000 soh stx etx lf A B C fe
0000010
" \
"" "$input"
@@ -24,9 +29,9 @@ SKIP=
optional !DESKTOP
testing "od -B (!DESKTOP)" \
- "od -B" \
+ "od -B | sed 's/ *$//'" \
"\
-0000000 001001 005003 041101 177103
+0000000 001001 005003 041101 177103
0000010
" \
"" "$input"
@@ -35,9 +40,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -o (!DESKTOP little-endian)" \
- "od -o" \
+ "od -o | sed 's/ *$//'" \
"\
-0000000 001001 005003 041101 177103
+0000000 001001 005003 041101 177103
0000010
" \
"" "$input"
@@ -45,9 +50,9 @@ SKIP=
optional !DESKTOP
testing "od -b (!DESKTOP)" \
- "od -b" \
+ "od -b | sed 's/ *$//'" \
"\
-0000000 001 002 003 012 101 102 103 376
+0000000 001 002 003 012 101 102 103 376
0000010
" \
"" "$input"
@@ -55,9 +60,9 @@ SKIP=
optional !DESKTOP
testing "od -c (!DESKTOP)" \
- "od -c" \
+ "od -c | sed 's/ *$//'" \
"\
-0000000 001 002 003 \\\\n A B C 376
+0000000 001 002 003 \\\\n A B C 376
0000010
" \
"" "$input"
@@ -66,9 +71,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -d (!DESKTOP little-endian)" \
- "od -d" \
+ "od -d | sed 's/ *$//'" \
"\
-0000000 00513 02563 16961 65091
+0000000 513 2563 16961 65091
0000010
" \
"" "$input"
@@ -77,9 +82,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -D (!DESKTOP little-endian)" \
- "od -D" \
+ "od -D | sed 's/ *$//'" \
"\
-0000000 0167969281 4265820737
+0000000 167969281 4265820737
0000010
" \
"" "$input"
@@ -88,9 +93,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -e (!DESKTOP little-endian)" \
- "od -e" \
+ "od -e | sed 's/ *$//'" \
"\
-0000000 -1.61218556514036e+300
+0000000 -1.61218556514036e+300
0000010
" \
"" "$input"
@@ -99,9 +104,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -F (!DESKTOP little-endian)" \
- "od -F" \
+ "od -F | sed 's/ *$//'" \
"\
-0000000 -1.61218556514036e+300
+0000000 -1.61218556514036e+300
0000010
" \
"" "$input"
@@ -109,9 +114,9 @@ testing "od -F (!DESKTOP little-endian)" \
optional !DESKTOP
$le || SKIP=1
testing "od -f (!DESKTOP little-endian)" \
- "od -f" \
+ "od -f | sed 's/ *$//'" \
"\
-0000000 6.3077975e-33 -6.4885867e+37
+0000000 6.3077975e-33 -6.4885867e+37
0000010
" \
"" "$input"
@@ -120,9 +125,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -H (!DESKTOP little-endian)" \
- "od -H" \
+ "od -H | sed 's/ *$//'" \
"\
-0000000 0a030201 fe434241
+0000000 0a030201 fe434241
0000010
" \
"" "$input"
@@ -131,9 +136,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -X (!DESKTOP little-endian)" \
- "od -X" \
+ "od -X | sed 's/ *$//'" \
"\
-0000000 0a030201 fe434241
+0000000 0a030201 fe434241
0000010
" \
"" "$input"
@@ -142,9 +147,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -h (!DESKTOP little-endian)" \
- "od -h" \
+ "od -h | sed 's/ *$//'" \
"\
-0000000 0201 0a03 4241 fe43
+0000000 0201 0a03 4241 fe43
0000010
" \
"" "$input"
@@ -153,9 +158,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -x (!DESKTOP little-endian)" \
- "od -x" \
+ "od -x | sed 's/ *$//'" \
"\
-0000000 0201 0a03 4241 fe43
+0000000 0201 0a03 4241 fe43
0000010
" \
"" "$input"
@@ -164,9 +169,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -I (!DESKTOP little-endian)" \
- "od -I" \
+ "od -I | sed 's/ *$//'" \
"\
-0000000 167969281 -29146559
+0000000 -125183517527965183
0000010
" \
"" "$input"
@@ -175,9 +180,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -L (!DESKTOP little-endian)" \
- "od -L" \
+ "od -L | sed 's/ *$//'" \
"\
-0000000 167969281 -29146559
+0000000 -125183517527965183
0000010
" \
"" "$input"
@@ -186,9 +191,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -i (!DESKTOP little-endian)" \
- "od -i" \
+ "od -i | sed 's/ *$//'" \
"\
-0000000 513 2563 16961 -445
+0000000 167969281 -29146559
0000010
" \
"" "$input"
@@ -197,9 +202,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -O (!DESKTOP little-endian)" \
- "od -O" \
+ "od -O | sed 's/ *$//'" \
"\
-0000000 01200601001 37620641101
+0000000 01200601001 37620641101
0000010
" \
"" "$input"
@@ -208,9 +213,9 @@ SKIP=
optional !DESKTOP
$le || SKIP=1
testing "od -l (!DESKTOP little-endian)" \
- "od -l" \
+ "od -l | sed 's/ *$//'" \
"\
-0000000 167969281 -29146559
+0000000 -125183517527965183
0000010
" \
"" "$input"