aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-05-25 17:39:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2023-05-25 17:40:20 +0200
commite2287f99fe6f21fd6435ad04340170ad4ba5f6b3 (patch)
tree09224d93a16e18c0f4e31ada2375d7ca9cfab03e /testsuite
parent64bdd7566c21cb53cb4c384ed52845106529e55f (diff)
downloadbusybox-w32-e2287f99fe6f21fd6435ad04340170ad4ba5f6b3.tar.gz
busybox-w32-e2287f99fe6f21fd6435ad04340170ad4ba5f6b3.tar.bz2
busybox-w32-e2287f99fe6f21fd6435ad04340170ad4ba5f6b3.zip
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 @@
9input="$(printf '\001\002\003\nABC\xfe')" 9input="$(printf '\001\002\003\nABC\xfe')"
10 10
11le=false 11le=false
12{ printf '\0\1' | od -i | grep -q 256; } && le=true 12{ printf '\0\1' | od -s | grep -q 256; } && le=true
13readonly le 13readonly le
14 14
15# NB:
16# sed 's/ *$//' truncates trailing spaces.
17# This needs to be fixed properly (not output them).
18# For now, the tests ignore them (does not require a match).
19
15optional !DESKTOP 20optional !DESKTOP
16testing "od -a (!DESKTOP)" \ 21testing "od -a (!DESKTOP)" \
17 "od -a" \ 22 "od -a | sed 's/ *$//'" \
18"\ 23"\
190000000 soh stx etx lf A B C fe 240000000 soh stx etx lf A B C fe
200000010 250000010
21" \ 26" \
22 "" "$input" 27 "" "$input"
@@ -24,9 +29,9 @@ SKIP=
24 29
25optional !DESKTOP 30optional !DESKTOP
26testing "od -B (!DESKTOP)" \ 31testing "od -B (!DESKTOP)" \
27 "od -B" \ 32 "od -B | sed 's/ *$//'" \
28"\ 33"\
290000000 001001 005003 041101 177103 340000000 001001 005003 041101 177103
300000010 350000010
31" \ 36" \
32 "" "$input" 37 "" "$input"
@@ -35,9 +40,9 @@ SKIP=
35optional !DESKTOP 40optional !DESKTOP
36$le || SKIP=1 41$le || SKIP=1
37testing "od -o (!DESKTOP little-endian)" \ 42testing "od -o (!DESKTOP little-endian)" \
38 "od -o" \ 43 "od -o | sed 's/ *$//'" \
39"\ 44"\
400000000 001001 005003 041101 177103 450000000 001001 005003 041101 177103
410000010 460000010
42" \ 47" \
43 "" "$input" 48 "" "$input"
@@ -45,9 +50,9 @@ SKIP=
45 50
46optional !DESKTOP 51optional !DESKTOP
47testing "od -b (!DESKTOP)" \ 52testing "od -b (!DESKTOP)" \
48 "od -b" \ 53 "od -b | sed 's/ *$//'" \
49"\ 54"\
500000000 001 002 003 012 101 102 103 376 550000000 001 002 003 012 101 102 103 376
510000010 560000010
52" \ 57" \
53 "" "$input" 58 "" "$input"
@@ -55,9 +60,9 @@ SKIP=
55 60
56optional !DESKTOP 61optional !DESKTOP
57testing "od -c (!DESKTOP)" \ 62testing "od -c (!DESKTOP)" \
58 "od -c" \ 63 "od -c | sed 's/ *$//'" \
59"\ 64"\
600000000 001 002 003 \\\\n A B C 376 650000000 001 002 003 \\\\n A B C 376
610000010 660000010
62" \ 67" \
63 "" "$input" 68 "" "$input"
@@ -66,9 +71,9 @@ SKIP=
66optional !DESKTOP 71optional !DESKTOP
67$le || SKIP=1 72$le || SKIP=1
68testing "od -d (!DESKTOP little-endian)" \ 73testing "od -d (!DESKTOP little-endian)" \
69 "od -d" \ 74 "od -d | sed 's/ *$//'" \
70"\ 75"\
710000000 00513 02563 16961 65091 760000000 513 2563 16961 65091
720000010 770000010
73" \ 78" \
74 "" "$input" 79 "" "$input"
@@ -77,9 +82,9 @@ SKIP=
77optional !DESKTOP 82optional !DESKTOP
78$le || SKIP=1 83$le || SKIP=1
79testing "od -D (!DESKTOP little-endian)" \ 84testing "od -D (!DESKTOP little-endian)" \
80 "od -D" \ 85 "od -D | sed 's/ *$//'" \
81"\ 86"\
820000000 0167969281 4265820737 870000000 167969281 4265820737
830000010 880000010
84" \ 89" \
85 "" "$input" 90 "" "$input"
@@ -88,9 +93,9 @@ SKIP=
88optional !DESKTOP 93optional !DESKTOP
89$le || SKIP=1 94$le || SKIP=1
90testing "od -e (!DESKTOP little-endian)" \ 95testing "od -e (!DESKTOP little-endian)" \
91 "od -e" \ 96 "od -e | sed 's/ *$//'" \
92"\ 97"\
930000000 -1.61218556514036e+300 980000000 -1.61218556514036e+300
940000010 990000010
95" \ 100" \
96 "" "$input" 101 "" "$input"
@@ -99,9 +104,9 @@ SKIP=
99optional !DESKTOP 104optional !DESKTOP
100$le || SKIP=1 105$le || SKIP=1
101testing "od -F (!DESKTOP little-endian)" \ 106testing "od -F (!DESKTOP little-endian)" \
102 "od -F" \ 107 "od -F | sed 's/ *$//'" \
103"\ 108"\
1040000000 -1.61218556514036e+300 1090000000 -1.61218556514036e+300
1050000010 1100000010
106" \ 111" \
107 "" "$input" 112 "" "$input"
@@ -109,9 +114,9 @@ testing "od -F (!DESKTOP little-endian)" \
109optional !DESKTOP 114optional !DESKTOP
110$le || SKIP=1 115$le || SKIP=1
111testing "od -f (!DESKTOP little-endian)" \ 116testing "od -f (!DESKTOP little-endian)" \
112 "od -f" \ 117 "od -f | sed 's/ *$//'" \
113"\ 118"\
1140000000 6.3077975e-33 -6.4885867e+37 1190000000 6.3077975e-33 -6.4885867e+37
1150000010 1200000010
116" \ 121" \
117 "" "$input" 122 "" "$input"
@@ -120,9 +125,9 @@ SKIP=
120optional !DESKTOP 125optional !DESKTOP
121$le || SKIP=1 126$le || SKIP=1
122testing "od -H (!DESKTOP little-endian)" \ 127testing "od -H (!DESKTOP little-endian)" \
123 "od -H" \ 128 "od -H | sed 's/ *$//'" \
124"\ 129"\
1250000000 0a030201 fe434241 1300000000 0a030201 fe434241
1260000010 1310000010
127" \ 132" \
128 "" "$input" 133 "" "$input"
@@ -131,9 +136,9 @@ SKIP=
131optional !DESKTOP 136optional !DESKTOP
132$le || SKIP=1 137$le || SKIP=1
133testing "od -X (!DESKTOP little-endian)" \ 138testing "od -X (!DESKTOP little-endian)" \
134 "od -X" \ 139 "od -X | sed 's/ *$//'" \
135"\ 140"\
1360000000 0a030201 fe434241 1410000000 0a030201 fe434241
1370000010 1420000010
138" \ 143" \
139 "" "$input" 144 "" "$input"
@@ -142,9 +147,9 @@ SKIP=
142optional !DESKTOP 147optional !DESKTOP
143$le || SKIP=1 148$le || SKIP=1
144testing "od -h (!DESKTOP little-endian)" \ 149testing "od -h (!DESKTOP little-endian)" \
145 "od -h" \ 150 "od -h | sed 's/ *$//'" \
146"\ 151"\
1470000000 0201 0a03 4241 fe43 1520000000 0201 0a03 4241 fe43
1480000010 1530000010
149" \ 154" \
150 "" "$input" 155 "" "$input"
@@ -153,9 +158,9 @@ SKIP=
153optional !DESKTOP 158optional !DESKTOP
154$le || SKIP=1 159$le || SKIP=1
155testing "od -x (!DESKTOP little-endian)" \ 160testing "od -x (!DESKTOP little-endian)" \
156 "od -x" \ 161 "od -x | sed 's/ *$//'" \
157"\ 162"\
1580000000 0201 0a03 4241 fe43 1630000000 0201 0a03 4241 fe43
1590000010 1640000010
160" \ 165" \
161 "" "$input" 166 "" "$input"
@@ -164,9 +169,9 @@ SKIP=
164optional !DESKTOP 169optional !DESKTOP
165$le || SKIP=1 170$le || SKIP=1
166testing "od -I (!DESKTOP little-endian)" \ 171testing "od -I (!DESKTOP little-endian)" \
167 "od -I" \ 172 "od -I | sed 's/ *$//'" \
168"\ 173"\
1690000000 167969281 -29146559 1740000000 -125183517527965183
1700000010 1750000010
171" \ 176" \
172 "" "$input" 177 "" "$input"
@@ -175,9 +180,9 @@ SKIP=
175optional !DESKTOP 180optional !DESKTOP
176$le || SKIP=1 181$le || SKIP=1
177testing "od -L (!DESKTOP little-endian)" \ 182testing "od -L (!DESKTOP little-endian)" \
178 "od -L" \ 183 "od -L | sed 's/ *$//'" \
179"\ 184"\
1800000000 167969281 -29146559 1850000000 -125183517527965183
1810000010 1860000010
182" \ 187" \
183 "" "$input" 188 "" "$input"
@@ -186,9 +191,9 @@ SKIP=
186optional !DESKTOP 191optional !DESKTOP
187$le || SKIP=1 192$le || SKIP=1
188testing "od -i (!DESKTOP little-endian)" \ 193testing "od -i (!DESKTOP little-endian)" \
189 "od -i" \ 194 "od -i | sed 's/ *$//'" \
190"\ 195"\
1910000000 513 2563 16961 -445 1960000000 167969281 -29146559
1920000010 1970000010
193" \ 198" \
194 "" "$input" 199 "" "$input"
@@ -197,9 +202,9 @@ SKIP=
197optional !DESKTOP 202optional !DESKTOP
198$le || SKIP=1 203$le || SKIP=1
199testing "od -O (!DESKTOP little-endian)" \ 204testing "od -O (!DESKTOP little-endian)" \
200 "od -O" \ 205 "od -O | sed 's/ *$//'" \
201"\ 206"\
2020000000 01200601001 37620641101 2070000000 01200601001 37620641101
2030000010 2080000010
204" \ 209" \
205 "" "$input" 210 "" "$input"
@@ -208,9 +213,9 @@ SKIP=
208optional !DESKTOP 213optional !DESKTOP
209$le || SKIP=1 214$le || SKIP=1
210testing "od -l (!DESKTOP little-endian)" \ 215testing "od -l (!DESKTOP little-endian)" \
211 "od -l" \ 216 "od -l | sed 's/ *$//'" \
212"\ 217"\
2130000000 167969281 -29146559 2180000000 -125183517527965183
2140000010 2190000010
215" \ 220" \
216 "" "$input" 221 "" "$input"