Mercurial > hg > toybox
annotate tests/uudecode.test @ 1746:b11f536bac74 draft
install -D bugfix from David Halls.
(I tweaked some comment text while I was there.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 21 Mar 2015 15:49:38 -0500 |
parents | 8700cbe1cb29 |
children |
rev | line source |
---|---|
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
1 #!/bin/bash |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
2 |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
3 [ -f testing.sh ] && . testing.sh |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
4 |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
5 #testing "name" "command" "result" "infile" "stdin" |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
6 |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
7 testing "uudecode uu empty file" "uudecode -o /dev/stdout && echo yes" \ |
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
8 "yes\n" "" "begin 744 test\n\`\nend\n" |
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
9 testing "uudecode uu 1-char" "uudecode -o /dev/stdout" "a" "" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
10 "begin 744 test\n!80 \n\`\nend\n" |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
11 testing "uudecode uu 2-char" "uudecode -o /dev/stdout" "ab" "" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
12 "begin 744 test\n\"86( \n\`\nend\n" |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
13 testing "uudecode uu 3-char" "uudecode -o /dev/stdout" "abc" "" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
14 "begin 744 test\n#86)C\n\`\nend\n" |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
15 |
835
89c65a45245a
Incremental cleanup of uudecode.
Rob Landley <rob@landley.net>
parents:
833
diff
changeset
|
16 testing "uudecode b64 empty file" "uudecode -o /dev/stdout && echo yes" \ |
89c65a45245a
Incremental cleanup of uudecode.
Rob Landley <rob@landley.net>
parents:
833
diff
changeset
|
17 "yes\n" "" "begin-base64 744 test\n====\n" |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
18 testing "uudecode b64 1-char" "uudecode -o /dev/stdout" "a" "" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
19 "begin-base64 744 test\nYQ==\n====\n" |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
20 testing "uudecode b64 2-char" "uudecode -o /dev/stdout" "ab" "" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
21 "begin-base64 744 test\nYWI=\n====\n" |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
22 testing "uudecode b64 3-char" "uudecode -o /dev/stdout" "abc" "" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
23 "begin-base64 744 test\nYWJj\n====\n" |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
24 |
833
98dc18ed57a3
uudecode test should just call "uudecode" (not multiplexer via a path), and first test shouldn't succeed if toybox isn't even there.
Rob Landley <rob@landley.net>
parents:
828
diff
changeset
|
25 testing "uudecode filename" "uudecode && echo -ne 'abc' | cmp uudecode-fn-test /dev/stdin && echo -ne yes && rm uudecode-fn-test" \ |
828
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
26 "yes" "" "begin-base64 744 uudecode-fn-test\nYWJj\n====\n" |
1fdaba9a7124
uuencode/decode tests and tweaks from Erich Plondke.
Rob Landley <rob@landley.net>
parents:
diff
changeset
|
27 |