23 lines
348 B
Go
23 lines
348 B
Go
|
package folderwatcher
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestNotExistingFolder(t *testing.T) {
|
||
|
tmpPath, err := os.MkdirTemp("", ".folderwatcher_test")
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
_ = os.RemoveAll(tmpPath)
|
||
|
conf := Config{
|
||
|
Folder: tmpPath,
|
||
|
}
|
||
|
|
||
|
_, err = NewFolderWatcher(conf, true, nil)
|
||
|
if err == nil {
|
||
|
t.Fatal("expected error")
|
||
|
}
|
||
|
}
|