summaryrefslogtreecommitdiff
path: root/main_test.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-27 20:03:47 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-27 20:03:47 +0300
commit5b1cbb46faf4c082c95b9e61d62b790defecd06a (patch)
treebceda102bce26afe04ec60e6dc36050f3ae816f5 /main_test.go
parent1fcab8365e8bdcf5658bfa601916e074a39a71e7 (diff)
Chore: linter complaints
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/main_test.go b/main_test.go
deleted file mode 100644
index 998778c..0000000
--- a/main_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package main
-
-import (
- "fmt"
- "gf-lt/config"
- "gf-lt/models"
- "strings"
- "testing"
-)
-
-func TestRemoveThinking(t *testing.T) {
- cases := []struct {
- cb *models.ChatBody
- toolMsgs uint8
- }{
- {cb: &models.ChatBody{
- Stream: true,
- Messages: []models.RoleMsg{
- {Role: "tool", Content: "should be ommited"},
- {Role: "system", Content: "should stay"},
- {Role: "user", Content: "hello, how are you?"},
- {Role: "assistant", Content: "Oh, hi. <think>I should thank user and continue the conversation</think> I am geat, thank you! How are you?"},
- },
- },
- toolMsgs: uint8(1),
- },
- }
- for i, tc := range cases {
- t.Run(fmt.Sprintf("run_%d", i), func(t *testing.T) {
- cfg = &config.Config{ToolRole: "tool"} // Initialize cfg.ToolRole for test
- mNum := len(tc.cb.Messages)
- removeThinking(tc.cb)
- if len(tc.cb.Messages) != mNum-int(tc.toolMsgs) {
- t.Errorf("failed to delete tools msg %v; expected %d, got %d", tc.cb.Messages, mNum-int(tc.toolMsgs), len(tc.cb.Messages))
- }
- for _, msg := range tc.cb.Messages {
- if strings.Contains(msg.Content, "<think>") {
- t.Errorf("msg contains think tag; msg: %s\n", msg.Content)
- }
- }
- }) }
-}