diff --git a/identity/identity_test.go b/identity/identity_test.go index 01142b0..a93ef86 100644 --- a/identity/identity_test.go +++ b/identity/identity_test.go @@ -1,12 +1,15 @@ package identity import ( - "github.com/s-rah/go-ricochet/identity" "testing" ) func TestIdentity(t *testing.T) { - id := identity.Init("../testing/private_key") + id := Init("../testing/private_key") + if id.Initialized() == false { + t.Errorf("Identity should be initialized") + } + if id.Hostname() != "kwke2hntvyfqm7dr" { t.Errorf("Expected %v as Hostname() got: %v", "kwke2hntvyfqm7dr", id.Hostname()) } diff --git a/testing/tests.sh b/testing/tests.sh index 0da8fbe..c161f73 100755 --- a/testing/tests.sh +++ b/testing/tests.sh @@ -2,11 +2,12 @@ set -e pwd -go test -coverprofile=main.cover.out -v . -go test -coverprofile=utils.cover.out -v ./utils -go test -coverprofile=channels.cover.out -v ./channels -go test -coverprofile=connection.cover.out -v ./connection -go test -coverprofile=policies.cover.out -v ./policies +go test ${1} -coverprofile=main.cover.out -v . +go test ${1} -coverprofile=utils.cover.out -v ./utils +go test ${1} -coverprofile=channels.cover.out -v ./channels +go test ${1} -coverprofile=connection.cover.out -v ./connection +go test ${1} -coverprofile=policies.cover.out -v ./policies +go test ${1} -coverprofile=policies.cover.out -v ./identity echo "mode: set" > coverage.out && cat *.cover.out | grep -v mode: | sort -r | \ awk '{if($1 != last) {print $0;last=$1}}' >> coverage.out rm -rf *.cover.out