Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | [ -f testing.sh ] && . testing.sh |
| 4 | |
| 5 | #testing "name" "command" "result" "infile" "stdin" |
| 6 | |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 7 | testing "uu empty file" "uudecode -o - && echo yes" \ |
Rob Landley | 3e06a1c | 2013-03-27 00:04:43 -0500 | [diff] [blame] | 8 | "yes\n" "" "begin 744 test\n\`\nend\n" |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 9 | testing "uu 1-char" "uudecode -o -" "a" "" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 10 | "begin 744 test\n!80 \n\`\nend\n" |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 11 | testing "uu 2-char" "uudecode -o -" "ab" "" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 12 | "begin 744 test\n\"86( \n\`\nend\n" |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 13 | testing "uu 3-char" "uudecode -o -" "abc" "" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 14 | "begin 744 test\n#86)C\n\`\nend\n" |
| 15 | |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 16 | testing "b64 empty file" "uudecode -o - && echo yes" \ |
Rob Landley | f597042 | 2013-03-27 00:52:17 -0500 | [diff] [blame] | 17 | "yes\n" "" "begin-base64 744 test\n====\n" |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 18 | testing "b64 1-char" "uudecode -o -" "a" "" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 19 | "begin-base64 744 test\nYQ==\n====\n" |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 20 | testing "b64 2-char" "uudecode -o -" "ab" "" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 21 | "begin-base64 744 test\nYWI=\n====\n" |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 22 | testing "b64 3-char" "uudecode -o -" "abc" "" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 23 | "begin-base64 744 test\nYWJj\n====\n" |
| 24 | |
Elliott Hughes | 0956d16 | 2017-04-03 14:12:08 -0700 | [diff] [blame] | 25 | testing "filename" "uudecode && echo -ne 'abc' | cmp uudecode-fn-test - && echo -ne yes && rm uudecode-fn-test" \ |
Rob Landley | 64427a8 | 2013-03-22 00:26:12 -0500 | [diff] [blame] | 26 | "yes" "" "begin-base64 744 uudecode-fn-test\nYWJj\n====\n" |