middleware: fix test for pointer type Text field

This commit is contained in:
ParthSareen 2026-01-05 17:45:20 -08:00
parent fa42204da8
commit 9c27c72952
1 changed files with 2 additions and 2 deletions

View File

@ -472,8 +472,8 @@ func TestAnthropicWriter_NonStreaming(t *testing.T) {
if len(result.Content) != 1 { if len(result.Content) != 1 {
t.Fatalf("expected 1 content block, got %d", len(result.Content)) t.Fatalf("expected 1 content block, got %d", len(result.Content))
} }
if result.Content[0].Text != "Hello there!" { if result.Content[0].Text == nil || *result.Content[0].Text != "Hello there!" {
t.Errorf("expected text 'Hello there!', got %q", result.Content[0].Text) t.Errorf("expected text 'Hello there!', got %v", result.Content[0].Text)
} }
if result.StopReason != "end_turn" { if result.StopReason != "end_turn" {
t.Errorf("expected stop_reason 'end_turn', got %q", result.StopReason) t.Errorf("expected stop_reason 'end_turn', got %q", result.StopReason)