wip
This commit is contained in:
30
tagengine/sanitize_test.go
Normal file
30
tagengine/sanitize_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package tagengine
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestSanitize(t *testing.T) {
|
||||
sanitize := BasicSanitizer
|
||||
|
||||
type Case struct {
|
||||
In string
|
||||
Out string
|
||||
}
|
||||
|
||||
cases := []Case{
|
||||
{"", ""},
|
||||
{"123abc", "123 abc"},
|
||||
{"abc123", "abc 123"},
|
||||
{"abc123xyz", "abc 123 xyz"},
|
||||
{"1f2", "1 f 2"},
|
||||
{" abc", "abc"},
|
||||
{" ; KitKat/m&m's (bottle) @ ", "; kitkat / m & m ' s ( bottle ) @"},
|
||||
{"€", "€"},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
out := sanitize(tc.In)
|
||||
if out != tc.Out {
|
||||
t.Fatalf("%v != %v", out, tc.Out)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user