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

Function TestUnlock_KeepsFileOnDisk

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

Source from the content-addressed store, hash-verified

100}
101
102func TestUnlock_KeepsFileOnDisk(t *testing.T) {
103 l := newTestLock(t)
104
105 if err := l.TryLock(); err != nil {
106 t.Fatalf("TryLock failed: %v", err)
107 }
108 path := l.Path()
109 if err := l.Unlock(); err != nil {
110 t.Fatalf("Unlock failed: %v", err)
111 }
112
113 if _, err := os.Stat(path); os.IsNotExist(err) {
114 t.Error("lock file should remain on disk after Unlock")
115 }
116}
117
118func TestUnlock_Idempotent(t *testing.T) {
119 l := newTestLock(t)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected