Test suite using base58 CLI tool

This commit is contained in:
Luke Dashjr
2014-08-17 17:01:01 +00:00
parent 4e05a3d300
commit c0994385c3
9 changed files with 35 additions and 0 deletions

3
.gitignore vendored
View File

@@ -12,11 +12,14 @@ config.*
*.lo
autom4te.cache
ar-lib
test-driver
aclocal.m4
Makefile
Makefile.in
.deps
*.log
.libs
ii
*.tar*
base58
tests/*.trs

View File

@@ -20,3 +20,15 @@ bin_PROGRAMS = base58
base58_SOURCES = clitool.c
base58_CFLAGS = $(LIBGCRYPT_CFLAGS)
base58_LDADD = libbase58.la $(LIBGCRYPT_LIBS)
TESTS = \
tests/decode.sh \
tests/decode-b58c.sh \
tests/decode-b58c-fail.sh \
tests/decode-b58c-null.sh \
tests/encode.sh \
tests/encode-b58c.sh \
tests/encode-fail.sh
TEST_EXTENSIONS = .sh
SH_LOG_COMPILER = /bin/sh
AM_TESTS_ENVIRONMENT = PATH='$(srcdir)':"$$PATH"; export PATH;

View File

@@ -0,0 +1,2 @@
#!/bin/sh
! base58 -d 25 -c 19DXstMaV43WpYg4ceREiiTv2UntmoiA9a >/dev/null

View File

@@ -0,0 +1,3 @@
#!/bin/sh
hex=$(base58 -d 25 -c 19DXstMaV43WpYg4ceREiiTv2UntmoiA9a | xxd -p)
test x$hex = x

3
tests/decode-b58c.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
hex=$(base58 -d 25 -c 19DXstMaV43WpYg4ceREiiTv2UntmoiA9j | xxd -p)
test x$hex != x005a1fc5dd9e6f03819fca94a2d89669469667f9a1

3
tests/decode.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
hex=$(base58 -d 25 19DXstMaV43WpYg4ceREiiTv2UntmoiA9j | xxd -p)
test x$hex != x005a1fc5dd9e6f03819fca94a2d89669469667f9a1

3
tests/encode-b58c.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
b58=$(echo '005a1fc5dd9e6f03819fca94a2d89669469667f9a0' | xxd -r -p | base58 -c)
test x$b58 = x19DXstMaV43WpYg4ceREiiTv2UntmoiA9j

3
tests/encode-fail.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
b58=$(echo '005a1fc5dd9e6f03819fca94a2d89669469667f9a174655946' | xxd -r -p | base58)
test x$b58 != x19DXstMaV43WpYg4ceREiiTv2UntmoiA9j

3
tests/encode.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
b58=$(echo '005a1fc5dd9e6f03819fca94a2d89669469667f9a074655946' | xxd -r -p | base58)
test x$b58 = x19DXstMaV43WpYg4ceREiiTv2UntmoiA9j