MCPcopy Create free account
hub / github.com/diillson/chatcli / TestIsStale

Function TestIsStale

cli/workspace/bootstrap_test.go:94–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

92}
93
94func TestIsStale(t *testing.T) {
95 dir := t.TempDir()
96 path := filepath.Join(dir, "SOUL.md")
97 _ = os.WriteFile(path, []byte("v1"), 0o644)
98
99 bl := NewBootstrapLoader(dir, "", testLogger())
100 bl.LoadFile("SOUL.md")
101
102 if bl.IsStale() {
103 t.Error("should not be stale immediately after load")
104 }
105
106 time.Sleep(10 * time.Millisecond)
107 _ = os.WriteFile(path, []byte("v2"), 0o644)
108
109 if !bl.IsStale() {
110 t.Error("should be stale after file modification")
111 }
112}

Callers

nothing calls this directly

Calls 5

LoadFileMethod · 0.95
IsStaleMethod · 0.95
NewBootstrapLoaderFunction · 0.85
testLoggerFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected