2026-06-07 17:32:29 +08:00
|
|
|
package config
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"gopkg.in/yaml.v3"
|
|
|
|
|
)
|
|
|
|
|
|
2026-08-28 22:23:13 +08:00
|
|
|
func TestVectorDBConfigUnmarshalLibSQLPath(t *testing.T) {
|
2026-06-07 17:32:29 +08:00
|
|
|
raw := []byte(`
|
|
|
|
|
vectorDB:
|
2026-08-28 22:23:13 +08:00
|
|
|
path: data/agent/vectors.db
|
2026-06-07 17:32:29 +08:00
|
|
|
`)
|
|
|
|
|
|
|
|
|
|
var cfg Config
|
|
|
|
|
if err := yaml.Unmarshal(raw, &cfg); err != nil {
|
|
|
|
|
t.Fatalf("yaml.Unmarshal() error = %v", err)
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-28 22:23:13 +08:00
|
|
|
if cfg.VectorDB.Path != "data/agent/vectors.db" {
|
|
|
|
|
t.Fatalf("VectorDB.Path = %q", cfg.VectorDB.Path)
|
2026-06-07 17:32:29 +08:00
|
|
|
}
|
|
|
|
|
}
|