mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-04 19:51:18 +00:00
test: use exact match for tool name assertion
Address review feedback - drop function.name fallback and strings.Contains in favor of direct == comparison.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package chat_completions
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/tidwall/gjson"
|
||||
@@ -623,14 +622,9 @@ func TestToolsDefinitionTranslated(t *testing.T) {
|
||||
t.Fatal("no tools found in output")
|
||||
}
|
||||
|
||||
// look for "search" tool
|
||||
found := false
|
||||
for _, tool := range tools {
|
||||
name := tool.Get("name").String()
|
||||
if name == "" {
|
||||
name = tool.Get("function.name").String()
|
||||
}
|
||||
if strings.Contains(name, "search") {
|
||||
if tool.Get("name").String() == "search" {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user