mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-17 23:16:52 +00:00
Fix bug in Logger test where it creates file but doesn't delete (#236)
This commit is contained in:
committed by
Adrian Gallagher
parent
7413fc41b8
commit
b62a9c76b1
@@ -35,7 +35,16 @@ func TestSetupOutputsValidPath(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("SetupOutputs failed expected nil got %v", err)
|
||||
}
|
||||
os.Remove(path.Join(LogPath, Logger.File))
|
||||
|
||||
err = CloseLogFile()
|
||||
if err != nil {
|
||||
t.Fatalf("CloseLogFile failed with %v", err)
|
||||
}
|
||||
|
||||
err = os.Remove(path.Join(LogPath, Logger.File))
|
||||
if err != nil {
|
||||
t.Fatal("Test Failed - SetupOutputsValidPath() error could not remove test file", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetupOutputsInValidPath(t *testing.T) {
|
||||
@@ -48,7 +57,10 @@ func TestSetupOutputsInValidPath(t *testing.T) {
|
||||
t.Fatalf("SetupOutputs failed expected %v got %v", os.ErrNotExist, err)
|
||||
}
|
||||
}
|
||||
os.Remove(path.Join(LogPath, Logger.File))
|
||||
err = os.Remove(path.Join(LogPath, Logger.File))
|
||||
if err == nil {
|
||||
t.Fatal("Test Failed - SetupOutputsInValidPath() error cannot be nil")
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkDebugf(b *testing.B) {
|
||||
|
||||
Reference in New Issue
Block a user