(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestKnowledgeToolDefinition_Schema(t *testing.T) { |
| 55 | def := knowledgeToolDefinition() |
| 56 | if def.Function.Name != "knowledge" { |
| 57 | t.Fatalf("name = %q", def.Function.Name) |
| 58 | } |
| 59 | b, err := json.Marshal(def.Function.Parameters) |
| 60 | if err != nil { |
| 61 | t.Fatal(err) |
| 62 | } |
| 63 | for _, want := range []string{`"cmd"`, `"search"`, `"source"`, `"offset"`} { |
| 64 | if !strings.Contains(string(b), want) { |
| 65 | t.Errorf("parameters missing %s: %s", want, b) |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | func TestAppendKnowledgeRound(t *testing.T) { |
| 71 | hist, prompt := appendKnowledgeRound( |
nothing calls this directly
no test coverage detected