andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
496 stars 70 forks source link

Test all msgfilters against both MessageCreate and MessageUpdate #366

Closed rtrox closed 3 years ago

rtrox commented 3 years ago

Description

Following the pattern in #364, refactored the tests in msgfilter_test.go to be parametric, such that they test both MessageCreate and MessageUpdate. The same issue pointed out by @andersfylling exists in existing tests, looking to rectify that. This also fixes a bug, calling out here so we can just separately fix the bug if you choose not to merge (HasPrefix's test calls HasBotMentionPrefix instead when testing it's negative (passthrough) path).

Type of change

Checklist:

rtrox commented 3 years ago

Sorry @andersfylling this one's a little long. It's probably easier to review by looking at the source branch itself, as the content on most tests was changed.

andersfylling commented 3 years ago

Looks great, thank you so much!