diff --git a/cheapcash_test.go b/cheapcash_test.go index e257fec..7c5760b 100644 --- a/cheapcash_test.go +++ b/cheapcash_test.go @@ -1,6 +1,7 @@ package cheapcash_test import ( + "errors" "log" "os" "testing" @@ -29,6 +30,19 @@ func TestNew(t *testing.T) { } } +func TestNew_InvalidPath(t *testing.T) { + defer func(){ + if e := recover().(error); e != nil { + if !errors.Is(e, cheapcash.ErrInvalidPath) { + t.Error("expected ErrInvalidPath, got:", e) + } + } + }() + + _ = cheapcash.New("") + +} + func removeDirIfExists(path string) { dir, err := os.Stat(path) if err == nil {