package scale import "testing" func TestScoreMajority_communication(t *testing.T) { key, label := ScoreMajority(map[string]string{ "q1": "B", "q2": "B", "q3": "A", }, CommunicationLabels(), "平衡探索型") if key != "B" || label != "感受连接型" { t.Fatalf("got %s %s", key, label) } } func TestScoreMajority_emotion(t *testing.T) { key, label := ScoreMajority(map[string]string{ "q1": "C", "q2": "C", "q3": "C", }, EmotionLabels(), "平衡探索型") if key != "C" || label != "行动调节型" { t.Fatalf("got %s %s", key, label) } } func TestScoreMajority_empty(t *testing.T) { _, label := ScoreMajority(nil, CommunicationLabels(), "平衡探索型") if label != "平衡探索型" { t.Fatalf("got %s", label) } } func TestBuildResult_rich(t *testing.T) { r := BuildResult("communication-style", "B", "感受连接型") if r["overview"] == nil || r["tips"] == nil || r["scripts"] == nil { t.Fatalf("missing rich fields: %#v", r) } r2 := BuildResult("emotion-pattern", "A", "觉察表达型") if r2["growth_plan"] == nil || r2["faq"] == nil { t.Fatalf("missing emotion rich fields") } }