From 5c118a20d70b10c8de3f0b6d711295bb2a33c205 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sat, 12 Sep 2015 19:00:26 +0200 Subject: [PATCH] sharness: generalize test_check_peerid() License: MIT Signed-off-by: Christian Couder --- test/sharness/lib/test-lib.sh | 5 +++++ test/sharness/t0020-init.sh | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index 1d6866c48..d7e42a077 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -344,3 +344,8 @@ generic_stat() { esac $_STAT "$1" } + +test_check_peerid() { + test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46" +} + diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index 2a930ea9e..8416502b3 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -58,10 +58,6 @@ test_expect_success "ipfs config succeeds" ' test_cmp expected_config actual_config ' -test_check_peerid() { - test $(echo "$1" | tr -dC "[:alnum:]" | wc -c | tr -d " ") = "46" -} - test_expect_success "ipfs peer id looks good" ' PEERID=$(ipfs config Identity.PeerID) && test_check_peerid "$PEERID"