sk-matrix-project/app/wails/pkg/pid/pid_test.go

22 lines
267 B
Go
Raw Normal View History

2023-07-12 00:35:32 +08:00
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)
}