blob: 966359ecb66d1bef7d3695737f046d737395cdf3 [file] [log] [blame]
Rob Landley64427a82013-03-22 00:26:12 -05001#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
Elliott Hughes0956d162017-04-03 14:12:08 -07007testing "uu empty file" "uudecode -o - && echo yes" \
Rob Landley3e06a1c2013-03-27 00:04:43 -05008 "yes\n" "" "begin 744 test\n\`\nend\n"
Elliott Hughes0956d162017-04-03 14:12:08 -07009testing "uu 1-char" "uudecode -o -" "a" "" \
Rob Landley64427a82013-03-22 00:26:12 -050010 "begin 744 test\n!80 \n\`\nend\n"
Elliott Hughes0956d162017-04-03 14:12:08 -070011testing "uu 2-char" "uudecode -o -" "ab" "" \
Rob Landley64427a82013-03-22 00:26:12 -050012 "begin 744 test\n\"86( \n\`\nend\n"
Elliott Hughes0956d162017-04-03 14:12:08 -070013testing "uu 3-char" "uudecode -o -" "abc" "" \
Rob Landley64427a82013-03-22 00:26:12 -050014 "begin 744 test\n#86)C\n\`\nend\n"
15
Elliott Hughes0956d162017-04-03 14:12:08 -070016testing "b64 empty file" "uudecode -o - && echo yes" \
Rob Landleyf5970422013-03-27 00:52:17 -050017 "yes\n" "" "begin-base64 744 test\n====\n"
Elliott Hughes0956d162017-04-03 14:12:08 -070018testing "b64 1-char" "uudecode -o -" "a" "" \
Rob Landley64427a82013-03-22 00:26:12 -050019 "begin-base64 744 test\nYQ==\n====\n"
Elliott Hughes0956d162017-04-03 14:12:08 -070020testing "b64 2-char" "uudecode -o -" "ab" "" \
Rob Landley64427a82013-03-22 00:26:12 -050021 "begin-base64 744 test\nYWI=\n====\n"
Elliott Hughes0956d162017-04-03 14:12:08 -070022testing "b64 3-char" "uudecode -o -" "abc" "" \
Rob Landley64427a82013-03-22 00:26:12 -050023 "begin-base64 744 test\nYWJj\n====\n"
24
Elliott Hughes0956d162017-04-03 14:12:08 -070025testing "filename" "uudecode && echo -ne 'abc' | cmp uudecode-fn-test - && echo -ne yes && rm uudecode-fn-test" \
Rob Landley64427a82013-03-22 00:26:12 -050026 "yes" "" "begin-base64 744 uudecode-fn-test\nYWJj\n====\n"