From 274b3c5d0d14d47cedabf29e5e543916595047a2 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 2 Oct 2017 23:42:59 -0700 Subject: [PATCH] first pass at writing a test --- tests/test.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tests/test.bash diff --git a/tests/test.bash b/tests/test.bash new file mode 100755 index 0000000..b55322f --- /dev/null +++ b/tests/test.bash @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -eo pipefail; [[ $TRACE ]] && set -x + +plaintext=$(mktemp /tmp/cryptr.XXXXXXXX) +dd if=/dev/urandom bs=1024 count=1 2> /dev/null | LC_ALL=C tr -dc 'A-Za-z0-9' | head -c200 > "$plaintext" +plaintext_sha=$(shasum -a 256 "$plaintext") + +cryptr encrypt "$plaintext" +rm -f "$plaintext" +cryptr decrypt "$plaintext".aes + +decrypted_sha=$(shasum -a 256 "$plaintext") + +echo "$plaintext_sha" +echo "$decrypted_sha"