Browse Source

Add test

master
Jan-Lukas Else 6 months ago
parent
commit
be9f477458
  1. 8
      spamcheck_test.go

8
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()
}
})
}
Loading…
Cancel
Save