diff options
Diffstat (limited to 'utils/gen-compression-tests.bash')
-rwxr-xr-x | utils/gen-compression-tests.bash | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/utils/gen-compression-tests.bash b/utils/gen-compression-tests.bash new file mode 100755 index 0000000..70fa631 --- /dev/null +++ b/utils/gen-compression-tests.bash @@ -0,0 +1,31 @@ +#!/bin/bash +test_string='The quick brown fox jumps over the lazy dog' + +if [[ ${#} -lt 1 ]]; then + echo "Usage: ${0} <program-to-use>" + exit 1 +fi + +program=${1} + +empty=$(printf '' | ${program} | base64) +str=$(printf '%s' "${test_string}" | ${program} | base64) +split=$( + ( printf '%s' "${test_string::20}" | ${program} + printf '%s' "${test_string:20}" | ${program} ) | base64) + +cat <<_EOF_ + + BASE64 = b''' +${str} +''' + + EMPTY_BASE64 = b''' +${empty} +''' + + SPLIT_BASE64 = b''' +${split} +''' + +_EOF_ |