commento/api/utils_sanitise_test.go
Adhityaa a090770b73 api: Add go files
I know this is a huge commit, but I can't be bothered to check
this in part by part.
2018-05-27 23:40:46 +05:30

21 lines
432 B
Go

package main
import (
"testing"
)
func TestStripEmailBasics(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 {
if stripEmail(in) != out {
t.Errorf("for in=%s expected out=%s got out=%s", in, out, stripEmail(in))
return
}
}
}