package formula

import "testing"

func TestParseGeneratedDraftWithCodeFence(t *testing.T) {
	raw := "```json\n{\"text\":\"第一句\\n第二句\",\"topic_tag\":\"AI工具\",\"hook\":\"\",\"angle\":\"\",\"rationale\":\"\",\"structure_notes\":\"\"}\n```"
	got, err := ParseGeneratedDraft(raw)
	if err != nil {
		t.Fatalf("ParseGeneratedDraft() err = %v", err)
	}
	if got.Text == "" {
		t.Fatal("expected text")
	}
}
