diff options
author | Leonid Lisovskiy <lly.dev@gmail.com> | 2011-10-28 13:59:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-10-28 13:59:55 +0200 |
commit | 328f27fe447761f355104e7f524dc1115f16ca44 (patch) | |
tree | 1a8280c4cbc4458b89dda72c4d0c8f7402661355 /testsuite/uuencode.tests | |
parent | ec447c7f01acb0e3abd9daa52a1b616be3f39484 (diff) |
libbb: split decode_base64 off read_base64
function old new delta
decode_base64 - 182 +182
read_base64 378 255 -123
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/1 up/down: 182/-123) Total: 59 bytes
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/uuencode.tests')
-rwxr-xr-x | testsuite/uuencode.tests | 101 |
1 files changed, 98 insertions, 3 deletions
diff --git a/testsuite/uuencode.tests b/testsuite/uuencode.tests index cd6191b1b..6ce70f747 100755 --- a/testsuite/uuencode.tests +++ b/testsuite/uuencode.tests @@ -8,9 +8,9 @@ . ./testing.sh -# testing "test name" "options" "expected result" "file input" "stdin" -# file input will be file called "input" -# test can create a file "actual" instead of writing to stdout +# testing "test name" "command(s)" "expected result" "file input" "stdin" +# file input will be file called "input" +# test can create a file "actual" instead of writing to stdout # Test setup of standard input umask 0 @@ -24,4 +24,99 @@ testing "uuencode correct encoding" "uuencode bb_uuenc_test.out" \ testing "uuencode correct base64 encoding" "uuencode -m bb_uuenc_test.out" \ "begin-base64 644 bb_uuenc_test.out\nVGhlIGZhc3QgZ3JleSBmb3gganVtcGVkIG92ZXIgdGhlIGxhenkgYnJvd24g\nZG9nLgo=\n====\n" \ "" "The fast grey fox jumped over the lazy brown dog.\n" + +testing "uuencode empty file" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +` +end +' "" "" +testing "uuencode -m empty file" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +==== +' "" "" + +testing "uuencode file 'A'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +!00`` +` +end +A' "" "A" +testing "uuencode -m file 'A'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QQ== +==== +A' "" "A" + +testing "uuencode file 'AB'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +"04(` +` +end +AB' "" "AB" +testing "uuencode -m file 'AB'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QUI= +==== +AB' "" "AB" + +testing "uuencode file 'ABC'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +#04)# +` +end +ABC' "" "ABC" +testing "uuencode -m file 'ABC'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QUJD +==== +ABC' "" "ABC" + +testing "uuencode file 'ABCD'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +$04)#1``` +` +end +ABCD' "" "ABCD" +testing "uuencode -m file 'ABCD'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QUJDRA== +==== +ABCD' "" "ABCD" + +testing "uuencode file 'ABCDE'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +%04)#1$4` +` +end +ABCDE' "" "ABCDE" +testing "uuencode -m file 'ABCDE'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QUJDREU= +==== +ABCDE' "" "ABCDE" + +testing "uuencode file 'ABCDEF'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +&04)#1$5& +` +end +ABCDEF' "" "ABCDEF" +testing "uuencode -m file 'ABCDEF'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QUJDREVG +==== +ABCDEF' "" "ABCDEF" + +testing "uuencode file 'A<NUL><0xff>Z'" 'r=`uuencode FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin 644 FILE +$00#_6@`` +` +end +A\x0\xffZ' "" "A\x0\xffZ" +testing "uuencode -m file 'A<NUL><0xff>Z'" 'r=`uuencode -m FILE`; echo "$r"; echo "$r" | uudecode -o -;' \ +'begin-base64 644 FILE +QQD/Wg== +==== +A\x0\xffZ' "" "A\x0\xffZ" + exit $FAILCOUNT |