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

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)
}