From 69fdfe580b0f358950be4e0ba4e6bb4485ade942 Mon Sep 17 00:00:00 2001 From: jahway603 Date: Wed, 7 Jun 2023 23:48:28 -0400 Subject: [PATCH] added root_test.go --- cmd/root_test.go | 22 ++++++++++++++++++++++ common/logging/logging_test.go | 7 ++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 cmd/root_test.go diff --git a/cmd/root_test.go b/cmd/root_test.go new file mode 100644 index 0000000..540f8a8 --- /dev/null +++ b/cmd/root_test.go @@ -0,0 +1,22 @@ +// Copyright (c) 2019-2023 Duke Leto and The Hush developers +// Copyright (c) 2019-2020 The Zcash developers +// Distributed under the GPLv3 software license +package cmd + +import ( + "testing" +) + +func TestFileExists(t *testing.T) { + if fileExists("nonexistent-file") { + t.Fatal("fileExists unexpected success") + } + // If the path exists but is a directory, should return false + if fileExists(".") { + t.Fatal("fileExists unexpected success") + } + // The following file should exist, it's what's being tested + if !fileExists("root.go") { + t.Fatal("fileExists failed") + } +} diff --git a/common/logging/logging_test.go b/common/logging/logging_test.go index d723baa..6dc7c2a 100644 --- a/common/logging/logging_test.go +++ b/common/logging/logging_test.go @@ -1,6 +1,6 @@ +// Copyright (c) 2019-2023 Duke Leto and The Hush developers // Copyright (c) 2019-2020 The Zcash developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or https://www.opensource.org/licenses/mit-license.php . +// Distributed under the GPLv3 software license package logging import ( @@ -10,8 +10,9 @@ import ( "testing" "errors" - "github.com/sirupsen/logrus" + "git.hush.is/hush/lightwalletd/common" + "github.com/sirupsen/logrus" "google.golang.org/grpc" "google.golang.org/grpc/peer" )