enhance memory_write metadata and add /lang command

This commit is contained in:
DBT
2026-02-23 11:09:24 +00:00
parent 27d765f58b
commit ca64fa1559
3 changed files with 124 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
package tools
import (
"strings"
"testing"
)
func TestFormatMemoryLine(t *testing.T) {
got := formatMemoryLine("remember this", "high", "user", []string{"preference", "lang"})
if got == "" {
t.Fatal("empty formatted line")
}
if want := "importance=high"; !strings.Contains(got, want) {
t.Fatalf("expected %q in %q", want, got)
}
if want := "source=user"; !strings.Contains(got, want) {
t.Fatalf("expected %q in %q", want, got)
}
}
func TestNormalizeImportance(t *testing.T) {
if normalizeImportance("HIGH") != "high" {
t.Fatal("expected high")
}
if normalizeImportance("unknown") != "medium" {
t.Fatal("expected medium fallback")
}
}