This commit is contained in:
2026-06-13 01:34:45 +02:00
parent 408b29896c
commit 3cb2e466d8
21 changed files with 1285 additions and 130 deletions
+14 -10
View File
@@ -164,19 +164,23 @@ func TestProposeThreeDistinctWithInserts(t *testing.T) {
t.Errorf("proposal %d invalid: %v", i, err)
}
}
// The three proposals must use three distinct call styles from the palette
// (the user asked for variety in both style and position).
allowed := map[string]bool{"gel_gold": true, "gel_silver": true, "classic_white_outline": true}
seen := map[string]bool{}
// The three proposals must showcase distinct call looks: each style is a
// known preset, and no two proposals share the same font+style pairing.
seenStyle := map[string]bool{}
seenFont := map[string]bool{}
for i, tmpl := range out {
s := findElement(t, tmpl, ElemCallsign).StylePreset
if !allowed[s] {
t.Errorf("proposal %d: unexpected call style %q", i, s)
call := findElement(t, tmpl, ElemCallsign)
if _, ok := Presets[call.StylePreset]; !ok {
t.Errorf("proposal %d: unknown call style %q", i, call.StylePreset)
}
if seen[s] {
t.Errorf("proposal %d reuses call style %q", i, s)
if seenStyle[call.StylePreset] {
t.Errorf("proposal %d reuses call style %q", i, call.StylePreset)
}
seen[s] = true
if seenFont[call.Font] {
t.Errorf("proposal %d reuses call font %q", i, call.Font)
}
seenStyle[call.StylePreset] = true
seenFont[call.Font] = true
}
// At least one proposal uses the insert photos.
if countInserts(out[0]) == 0 && countInserts(out[1]) == 0 && countInserts(out[2]) == 0 {