MCPcopy
hub / github.com/larksuite/cli / TestTryLock_Success

Function TestTryLock_Success

internal/lockfile/lockfile_test.go:19–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func TestTryLock_Success(t *testing.T) {
20 l := newTestLock(t)
21
22 if err := l.TryLock(); err != nil {
23 t.Fatalf("TryLock failed: %v", err)
24 }
25 defer l.Unlock()
26
27 if _, err := os.Stat(l.Path()); os.IsNotExist(err) {
28 t.Error("lock file should exist after TryLock")
29 }
30}
31
32func TestTryLock_Conflict(t *testing.T) {
33 dir := t.TempDir()

Callers

nothing calls this directly

Calls 6

newTestLockFunction · 0.85
TryLockMethod · 0.80
UnlockMethod · 0.80
StatMethod · 0.65
PathMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected