diff options
| author | Grail Finder <wohilas@gmail.com> | 2025-12-09 15:03:21 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2025-12-09 15:03:21 +0300 |
| commit | e1bac8d0646ab9e6eab976dac0199807cb79a09e (patch) | |
| tree | 48605fef19e4c5840620d372577f617adedeae2b /main_test.go | |
| parent | 378dceb3f4dbb19554e568489d9773c00af4e114 (diff) | |
Feat: image prompt for llama.cpp /completion
Diffstat (limited to 'main_test.go')
| -rw-r--r-- | main_test.go | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/main_test.go b/main_test.go index fb0a774..84d23ba 100644 --- a/main_test.go +++ b/main_test.go @@ -3,6 +3,7 @@ package main import ( "gf-lt/models" "fmt" + "gf-lt/config" "strings" "testing" ) @@ -25,17 +26,17 @@ func TestRemoveThinking(t *testing.T) { }, } for i, tc := range cases { - t.Run(fmt.Sprintf("run_%d", i), func(t *testing.T) { - mNum := len(tc.cb.Messages) - removeThinking(tc.cb) - if len(tc.cb.Messages) != mNum-int(tc.toolMsgs) { - t.Error("failed to delete tools msg", tc.cb.Messages, cfg.ToolRole) - } - for _, msg := range tc.cb.Messages { - if strings.Contains(msg.Content, "<think>") { - t.Errorf("msg contains think tag; msg: %s\n", msg.Content) - } - } - }) - } + 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) + } + } + }) } } |
