(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestMaybeChatAskTurn_XMLKnowledgeLoop(t *testing.T) { |
| 150 | t.Setenv(chatAskEnvVar, "false") // knowledge alone must still handle the turn |
| 151 | t.Setenv(chatKnowledgeEnvVar, "true") |
| 152 | cli := newKnowledgeTestCLI(t) |
| 153 | cli.animation = NewAnimationManager() |
| 154 | cli.animation.SetSuppressed(true) |
| 155 | plugins.SetKnowledgeAdapter(&knowledgePluginAdapter{cli: cli}) |
| 156 | t.Cleanup(func() { plugins.SetKnowledgeAdapter(nil) }) |
| 157 | |
| 158 | fc := &knowledgeXMLFake{} |
| 159 | out, handled, err := cli.maybeChatAskTurn(context.Background(), fc, "como instalo?", "", nil, 500, SkillClientResolution{}, func() {}) |
| 160 | if !handled || err != nil { |
| 161 | t.Fatalf("handled=%v err=%v", handled, err) |
| 162 | } |
| 163 | if out != "xml grounded answer" { |
| 164 | t.Fatalf("out = %q", out) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestMaybeChatAskTurn_BothDisabled(t *testing.T) { |
| 169 | t.Setenv(chatAskEnvVar, "false") |
nothing calls this directly
no test coverage detected