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

Function TestStringifyMap

cli/plugins/builtin_memory_test.go:99–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

97}
98
99func TestStringifyMap(t *testing.T) {
100 out := stringifyMap(map[string]interface{}{
101 "a": "x", "n": float64(3), "b": true, "list": []interface{}{"p", "q"}, "skip": nil,
102 })
103 if out["a"] != "x" || out["n"] != "3" || out["b"] != "true" || out["list"] != "p, q" {
104 t.Errorf("stringifyMap wrong: %v", out)
105 }
106 if _, ok := out["skip"]; ok {
107 t.Error("nil values should be skipped")
108 }
109}
110
111func TestParseMemoryInvocation_Envelope(t *testing.T) {
112 cmd, inner, err := parseMemoryInvocation([]string{`{"cmd":"remember","args":{"content":"x","category":"personal"}}`})

Callers

nothing calls this directly

Calls 3

stringifyMapFunction · 0.85
ErrorfMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected