package threadspost

import (
	"strings"
	"testing"
)

func TestMimicLengthRange(t *testing.T) {
	min, max := MimicLengthRange("今天早餐吃了蛋餅\n加辣真的爽")
	if min <= 0 || max < min {
		t.Fatalf("MimicLengthRange() = %d, %d", min, max)
	}
}

func TestMimicLengthGuidanceIncludesReferenceStats(t *testing.T) {
	ref := "第一句\n第二句\n第三句"
	got := MimicLengthGuidance(ref)
	if got == "" {
		t.Fatal("MimicLengthGuidance() empty")
	}
	for _, part := range []string{"3 行", "精簡優先"} {
		if !strings.Contains(got, part) {
			t.Fatalf("MimicLengthGuidance() missing %q: %q", part, got)
		}
	}
}
