mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add banphrase tests
This commit is contained in:
parent
e247cbd11e
commit
7a702cb473
1 changed files with 30 additions and 0 deletions
30
cmd/bot/banphrase_test.go
Normal file
30
cmd/bot/banphrase_test.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package bot
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestBanphrase(t *testing.T) {
|
||||
t.Run("tests the banphrase api", func(t *testing.T) {
|
||||
// Banned message
|
||||
request, _ := CheckMessage("https://gyazo.com/asda")
|
||||
response := true
|
||||
|
||||
got := request
|
||||
want := response
|
||||
|
||||
if got != want {
|
||||
t.Errorf("got %v, want %v", got, want)
|
||||
}
|
||||
|
||||
// Okay message
|
||||
request, _ = CheckMessage("LUL")
|
||||
response = false
|
||||
|
||||
got = request
|
||||
want = response
|
||||
|
||||
if got != want {
|
||||
t.Errorf("got %v, want %v", got, want)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue