package phraser

import (
	"math/rand"
	"testing"
)

// The five embedded families, held to the rule internal/say holds the summary to:
// one variant means fixed. Reported per family, because a failure that names
// "some file" is a failure nobody acts on.
func TestEverySingleVariantEntryIsFixed(t *testing.T) {
	f, err := LoadFallbacks(rand.NewSource(1))
	if err != nil {
		t.Fatalf("LoadFallbacks: %v", err)
	}
	a, err := LoadAcks(rand.NewSource(1))
	if err != nil {
		t.Fatalf("LoadAcks: %v", err)
	}
	q, err := LoadQueries(rand.NewSource(1))
	if err != nil {
		t.Fatalf("LoadQueries: %v", err)
	}
	acts, err := LoadActs(rand.NewSource(1))
	if err != nil {
		t.Fatalf("LoadActs: %v", err)
	}
	confirms, err := LoadConfirms(rand.NewSource(1))
	if err != nil {
		t.Fatalf("LoadConfirms: %v", err)
	}
	for name, keys := range map[string][]string{
		"fallbacks": f.d.UnfixedSingles(),
		"acks":      a.d.UnfixedSingles(),
		"queries":   q.d.UnfixedSingles(),
		"acts":      acts.d.UnfixedSingles(),
		"confirms":  confirms.d.UnfixedSingles(),
	} {
		if len(keys) > 0 {
			t.Errorf("%s: single-variant entries not marked fixed: %v", name, keys)
		}
	}
}
