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
[x] Bug fix (non-breaking change which fixes an issue)
Checklist:
[x] I ran go generate
[x] I have performed a self-review of my own code (remember to run go fmt ./...)
~[ ] I have commented my code, particularly in hard-to-understand areas~
~[ ] I have made corresponding changes to the documentation~
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
~[ ] Any dependent changes have been merged and published in downstream modules~
~[ ] Added benchmarks if this is a performant required component (potential bottlenecks)~
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.
Description
Following the pattern in #364, refactored the tests in msgfilter_test.go to be parametric, such that they test both
MessageCreate
andMessageUpdate
. 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 callsHasBotMentionPrefix
instead when testing it's negative (passthrough) path).Type of change
Checklist:
go generate
go fmt ./...
)