mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 09:28:14 +00:00
- _sdk_local/ removed (moved to standalone sdk repo) - internal/agent/core: NoMemory/Cleaner data-flow breakpoints - internal/memory: clean_text, document store refactor - internal/plugin/registry.go: plugin API alignment - docs: PLUGIN_DEV.md, ARCHITECTURE.md NoMemory/Cleaner docs - plan.md, review.md: status update
28 lines
475 B
Go
28 lines
475 B
Go
package memory
|
||
|
||
import (
|
||
"testing"
|
||
)
|
||
|
||
func TestCleanTextTrim(t *testing.T) {
|
||
tests := []struct {
|
||
input string
|
||
expected string
|
||
}{
|
||
{" hello ", "hello"},
|
||
{",hello", "hello"},
|
||
{",,hello", "hello"},
|
||
{" ,,hello ", "hello"},
|
||
{"", ""},
|
||
{" ", ""},
|
||
{",", ""},
|
||
{",x", "x"},
|
||
}
|
||
for _, tt := range tests {
|
||
got := CleanText(tt.input)
|
||
if got != tt.expected {
|
||
t.Errorf("CleanText(%q) = %q, want %q", tt.input, got, tt.expected)
|
||
}
|
||
}
|
||
}
|