think_test.go

 1package claudetool
 2
 3import (
 4	"context"
 5	"encoding/json"
 6	"testing"
 7)
 8
 9func TestThinkRun(t *testing.T) {
10	input := struct {
11		Thoughts string `json:"thoughts"`
12	}{
13		Thoughts: "This is a test thought",
14	}
15
16	inputBytes, err := json.Marshal(input)
17	if err != nil {
18		t.Fatal(err)
19	}
20
21	result := thinkRun(context.Background(), inputBytes)
22
23	if result.Error != nil {
24		t.Errorf("unexpected error: %v", result.Error)
25	}
26
27	if len(result.LLMContent) == 0 {
28		t.Error("expected LLM content")
29	}
30
31	if result.LLMContent[0].Text != "recorded" {
32		t.Errorf("expected 'recorded', got %q", result.LLMContent[0].Text)
33	}
34}