package prompt import "testing" func TestApplyKnownStyle(t *testing.T) { got, err := Apply("a cat", "photo") if err != nil { t.Fatalf("Apply: %v", err) } want := "a cat, photorealistic, sharp focus, natural lighting" if got != want { t.Errorf("got %q, want %q", got, want) } } func TestApplyEmptyStylePassThrough(t *testing.T) { got, err := Apply("a cat", "") if err != nil || got != "a cat" { t.Errorf("got (%q,%v)", got, err) } } func TestApplyUnknownStyleErrors(t *testing.T) { if _, err := Apply("a cat", "nonsense"); err == nil { t.Errorf("expected error for unknown style") } } func TestApplyToEmptyPromptUsesPresetOnly(t *testing.T) { got, err := Apply("", "photo") if err != nil { t.Fatalf("Apply: %v", err) } if got == "" || got[0] == ',' { t.Errorf("unexpected output %q", got) } } func TestStylesContainsAllExpected(t *testing.T) { want := []string{"3d-render", "anime", "blog-header", "cinematic", "diagram", "illustration", "isometric", "line-art", "photo", "sketch", "watercolor"} got := Styles() if len(got) != len(want) { t.Fatalf("Styles() = %v, want %v", got, want) } for i, w := range want { if got[i] != w { t.Errorf("Styles()[%d] = %q, want %q", i, got[i], w) } } }