commento/api/utils_sanitise_test.go

21 lines
432 B
Go
Raw Normal View History

package main
import (
"testing"
)
2018-07-24 15:00:45 +08:00
func TestEmailStripBasics(t *testing.T) {
tests := map[string]string{
"test@example.com": "test@example.com",
"test+strip@example.com": "test@example.com",
"test+strip+strip2@example.com": "test@example.com",
}
for in, out := range tests {
2018-07-24 15:00:45 +08:00
if emailStrip(in) != out {
t.Errorf("for in=%s expected out=%s got out=%s", in, out, emailStrip(in))
return
}
}
}