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

Function TestContextBuilder_DynamicContext

cli/workspace/context_builder_test.go:66–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestContextBuilder_DynamicContext(t *testing.T) {
67 bl := NewBootstrapLoader(t.TempDir(), t.TempDir(), testLogger())
68 ms := NewMemoryStore(t.TempDir(), testLogger())
69 wsDir := t.TempDir()
70 cb := NewContextBuilder(bl, ms, wsDir)
71
72 dyn := cb.BuildDynamicContext()
73 if !strings.Contains(dyn, "Current date and time") {
74 t.Errorf("expected dynamic context with date, got %q", dyn)
75 }
76 if !strings.Contains(dyn, "Current working directory: "+wsDir) {
77 t.Errorf("expected CWD in dynamic context, got %q", dyn)
78 }
79 if !strings.Contains(dyn, "IMPORTANT") {
80 t.Errorf("expected disambiguation instruction in dynamic context, got %q", dyn)
81 }
82}
83
84func TestContextBuilder_InvalidateCache(t *testing.T) {
85 wsDir := t.TempDir()

Callers

nothing calls this directly

Calls 6

BuildDynamicContextMethod · 0.95
NewBootstrapLoaderFunction · 0.85
NewContextBuilderFunction · 0.85
ErrorfMethod · 0.80
testLoggerFunction · 0.70
NewMemoryStoreFunction · 0.70

Tested by

no test coverage detected