wails-app-dock/pkg/pid/pid_test.go
2024-02-17 21:45:43 +08:00

22 lines
267 B
Go

package pid
import (
"testing"
"time"
)
func TestPidLock_Lock(t *testing.T) {
name := "./.pid"
lock := NewPidLock(name)
err := lock.Lock()
defer func(lock *PidLock) {
lock.UnLock()
}(lock)
if err != nil {
t.Fatal(t)
}
time.Sleep(10 * time.Second)
}