MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / TestTryCreateLockFile_AlreadyExists

Function TestTryCreateLockFile_AlreadyExists

token/lockfile_test.go:97–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestTryCreateLockFile_AlreadyExists(t *testing.T) {
98 dir := t.TempDir()
99 path := filepath.Join(dir, "test.lock")
100
101 require.NoError(t, tryCreateLockFile(path))
102
103 // second create should fail with "already exists"
104 err := tryCreateLockFile(path)
105 require.Error(t, err)
106 assert.True(t, os.IsExist(err))
107}
108
109func TestNewSelfLockContent(t *testing.T) {
110 content, err := newSelfLockContent()

Callers

nothing calls this directly

Calls 2

tryCreateLockFileFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected