Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/duckhunt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
11 changes: 11 additions & 0 deletions plugins/duckhunt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down