@cryptotaxi247 / kubo / commits / 5c118a20d

sharness: generalize test_check_peerid()

License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Christian Couder committed Sep 12, 2015 at 19:00 UTC 5c118a20d70b10c8de3f0b6d711295bb2a33c205
2 files changed +5 -4
test/sharness/lib/test-lib.sh
+5
@@ -344,3 +344,8 @@ generic_stat() {
344 esac
345 $_STAT "$1"
346 }
347 +
348 +test_check_peerid() {
349 + test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46"
350 +}
351 +
test/sharness/t0020-init.sh
-4
@@ -58,10 +58,6 @@ test_expect_success "ipfs config succeeds" '
58 test_cmp expected_config actual_config
59 '
60
61 -test_check_peerid() {
62 - test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46"
63 -}
64 -
61 test_expect_success "ipfs peer id looks good" '
62 PEERID=$(ipfs config Identity.PeerID) &&
63 test_check_peerid "$PEERID"