From be9f477458ea1f4fb9a96517c28728afab14d4ab Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Thu, 22 Oct 2020 20:20:32 +0200 Subject: [PATCH] Add test --- spamcheck_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spamcheck_test.go b/spamcheck_test.go index 5b75282..01d4c28 100644 --- a/spamcheck_test.go +++ b/spamcheck_test.go @@ -8,7 +8,7 @@ import ( func Test_checkBlacklist(t *testing.T) { prepare := func() { os.Clearenv() - _ = os.Setenv("BLACKLIST", "test1,test2") + _ = os.Setenv("BLACKLIST", "test1,test2,spam word") appConfig, _ = parseConfig() } t.Run("Allowed values", func(t *testing.T) { @@ -23,4 +23,10 @@ func Test_checkBlacklist(t *testing.T) { t.Error() } }) + t.Run("Multi word spam phrase", func(t *testing.T) { + prepare() + if checkBlacklist([]string{"This is a sPaM WORD"}) == false { + t.Error() + } + }) }