From 7a702cb4731119ef76fb8b422161d8f8df0574fe Mon Sep 17 00:00:00 2001 From: lyx0 Date: Thu, 28 Oct 2021 23:01:05 +0200 Subject: [PATCH] add banphrase tests --- cmd/bot/banphrase_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmd/bot/banphrase_test.go diff --git a/cmd/bot/banphrase_test.go b/cmd/bot/banphrase_test.go new file mode 100644 index 0000000..302ebb4 --- /dev/null +++ b/cmd/bot/banphrase_test.go @@ -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) + } + + }) +}