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

Function TestManager_ProcessExtraction

cli/workspace/memory/store_test.go:57–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestManager_ProcessExtraction(t *testing.T) {
58 dir := t.TempDir()
59 mgr := NewManager(dir, DefaultConfig(), testLogger())
60
61 response := `## DAILY
62- Modified cli/workspace/memory/store.go
63- Added new profile system
64
65## LONGTERM
66- ChatCLI uses Go 1.25 with Bubble Tea TUI framework
67- User prefers Portuguese for conversation
68
69## PROFILE_UPDATE
70name=Edilson
71role=Software Engineer
72expertise_level=expert
73preferred_language=Portuguese
74
75## TOPICS
76Go, Bubble Tea, memory systems, TUI
77
78## PROJECTS
79project_name=chatcli
80project_path=/Users/edilson/GolandProjects/chatcli
81project_status=active
82project_technologies=Go, Bubble Tea`
83
84 mgr.ProcessExtraction(response)
85
86 // Check profile
87 profile := mgr.Profile.Get()
88 if profile.Name != "Edilson" {
89 t.Errorf("expected name Edilson, got %q", profile.Name)
90 }
91 if profile.Role != "Software Engineer" {
92 t.Errorf("expected role, got %q", profile.Role)
93 }
94
95 // Check topics
96 topics := mgr.Topics.GetAll()
97 if len(topics) < 3 {
98 t.Errorf("expected at least 3 topics, got %d", len(topics))
99 }
100
101 // Check projects
102 projects := mgr.Projects.GetAll()
103 if len(projects) != 1 {
104 t.Errorf("expected 1 project, got %d", len(projects))
105 }
106
107 // Check facts
108 if mgr.Facts.Count() < 1 {
109 t.Error("expected at least one fact from LONGTERM section")
110 }
111}
112
113func TestManager_RelevantContext(t *testing.T) {
114 dir := t.TempDir()

Callers

nothing calls this directly

Calls 9

ProcessExtractionMethod · 0.95
ErrorfMethod · 0.80
NewManagerFunction · 0.70
DefaultConfigFunction · 0.70
testLoggerFunction · 0.70
GetMethod · 0.65
CountMethod · 0.65
ErrorMethod · 0.65
GetAllMethod · 0.45

Tested by

no test coverage detected