From 3e3cfa849e8e1b6a82bb2a5656fe670a0cffafeb Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Mon, 18 Aug 2014 20:22:09 +0000 Subject: [PATCH] tests: Check small decode/encode --- Makefile.am | 4 +++- tests/decode-small.sh | 3 +++ tests/encode-small.sh | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/decode-small.sh create mode 100644 tests/encode-small.sh diff --git a/Makefile.am b/Makefile.am index 348c888..a788880 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,10 +29,12 @@ TESTS = \ tests/decode-b58c-null.sh \ tests/decode-b58c-toolong.sh \ tests/decode-b58c-tooshort.sh \ + tests/decode-small.sh \ tests/decode-zero.sh \ tests/encode.sh \ tests/encode-b58c.sh \ - tests/encode-fail.sh + tests/encode-fail.sh \ + tests/encode-small.sh SH_LOG_COMPILER = /bin/sh AM_TESTS_ENVIRONMENT = PATH='$(srcdir)':"$$PATH"; export PATH; endif diff --git a/tests/decode-small.sh b/tests/decode-small.sh new file mode 100644 index 0000000..acd3bc6 --- /dev/null +++ b/tests/decode-small.sh @@ -0,0 +1,3 @@ +#!/bin/sh +hex=$(base58 -d 4 2 | xxd -p) +test x$hex = x01 diff --git a/tests/encode-small.sh b/tests/encode-small.sh new file mode 100644 index 0000000..790e95c --- /dev/null +++ b/tests/encode-small.sh @@ -0,0 +1,3 @@ +#!/bin/sh +b58=$(base58 1) +test x$b58 = xr