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

Function TestIsLockFileStale_EmptyFile

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

Source from the content-addressed store, hash-verified

42}
43
44func TestIsLockFileStale_EmptyFile(t *testing.T) {
45 // backward compat: old lock files are empty
46 dir := t.TempDir()
47 path := filepath.Join(dir, "test.lock")
48 require.NoError(t, os.WriteFile(path, []byte{}, 0600))
49
50 stale, _, err := isLockFileStale(path)
51 require.NoError(t, err)
52 assert.True(t, stale)
53}
54
55func TestIsLockFileStale_CorruptFile(t *testing.T) {
56 dir := t.TempDir()

Callers

nothing calls this directly

Calls 1

isLockFileStaleFunction · 0.85

Tested by

no test coverage detected