package imagegen import ( "testing" "gitea.stevedudenhoeffer.com/steve/majordomo/llm" ) func TestRequestApply(t *testing.T) { base := Request{Prompt: "a red bicycle"} got := base.Apply(WithN(3), WithSize("1024x1024")) if got.Prompt != "a red bicycle" { t.Errorf("Prompt = %q, want %q", got.Prompt, "a red bicycle") } if got.N != 3 { t.Errorf("N = %d, want 3", got.N) } if got.Size != "1024x1024" { t.Errorf("Size = %q, want %q", got.Size, "1024x1024") } // Apply must not mutate the receiver (options apply to a copy). if base.N != 0 || base.Size != "" { t.Errorf("base mutated: %+v", base) } } func TestApplyModelOptions(t *testing.T) { // No options yet; just verify it returns a usable zero config. _ = ApplyModelOptions(nil) } // TestImageIsImagePart pins the alias so generated images stay interchangeable // with chat content. func TestImageIsImagePart(t *testing.T) { var img Image = llm.ImagePart{MIME: "image/png", Data: []byte{0x89, 'P', 'N', 'G'}} var part llm.Part = img // must satisfy llm.Part for use in messages if _, ok := part.(llm.ImagePart); !ok { t.Fatalf("Image does not round-trip as llm.ImagePart") } }