mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-17 08:18:51 +00:00
17 lines
449 B
Go
17 lines
449 B
Go
package textcontent
|
|
|
|
import "testing"
|
|
|
|
func TestSupportedText(t *testing.T) {
|
|
for _, s := range []string{"", "\ufeffname\tcity\r\nRenée 東京\n", "Καλημέρα\fnext page"} {
|
|
if err := Validate([]byte(s)); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|
|
for _, s := range []string{"nul\x00", "escape\x1b", "invalid\xff", "control\u0085"} {
|
|
if err := Validate([]byte(s)); err == nil {
|
|
t.Fatal("accepted binary controls or invalid UTF-8")
|
|
}
|
|
}
|
|
}
|