2
0
mirror of synced 2025-02-23 22:28:11 +00:00
torrent/util/dirwatch/dirwatch_test.go
Eng Zer Jun 841a702e34
test: use T.TempDir to create temporary test directory (#718)
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-02-02 18:26:46 +11:00

16 lines
253 B
Go

package dirwatch
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestDirwatch(t *testing.T) {
tempDirName := t.TempDir()
t.Logf("tempdir: %q", tempDirName)
dw, err := New(tempDirName)
require.NoError(t, err)
defer dw.Close()
}