diff --git a/plugins/duckhunt.go b/plugins/duckhunt.go index b1b7904..55b0f4e 100644 --- a/plugins/duckhunt.go +++ b/plugins/duckhunt.go @@ -1721,7 +1721,7 @@ func xpToNextLevel(xp int64) int64 { func duckName(state *duckHuntState) string { if state != nil && state.golden { - return ircColor(ircYellow, "the GOLDEN DUCK") + return "the " + ircColor(ircYellow, "GOLDEN DUCK") } if state != nil && state.flockRemaining > 1 { return ircColor(ircCyan, "a duck in the flock") diff --git a/plugins/duckhunt_test.go b/plugins/duckhunt_test.go index f0d0937..bd76d82 100644 --- a/plugins/duckhunt_test.go +++ b/plugins/duckhunt_test.go @@ -307,6 +307,17 @@ func TestDuckHuntAnnouncementKeepsDuckASCIICompact(t *testing.T) { } } +func TestDuckHuntGoldenDuckColorStartsAtLabel(t *testing.T) { + got := duckName(&duckHuntState{golden: true}) + want := "the " + ircColor(ircYellow, "GOLDEN DUCK") + if got != want { + t.Fatalf("golden duck name = %q, want %q", got, want) + } + if strings.HasPrefix(got, ircYellow) { + t.Fatal("the article must not be yellow") + } +} + func TestDuckHuntSchedulesAfterActivityThreshold(t *testing.T) { plugin := &DuckHunt{} if err := plugin.Init(bot.PluginConfig{