mapserver/mapobjectdb/utf8_test.go

25 lines
395 B
Go
Raw Normal View History

package mapobjectdb
import (
"testing"
"unicode/utf8"
)
func TestInvalidUtf8(t *testing.T) {
if utf8.Valid([]byte{0xe1, 0x7f, 0xc7}) {
t.Error("should be invalid")
}
}
func TestValidUtf8(t *testing.T) {
if !utf8.Valid([]byte("some valid string")) {
t.Error("should be valid")
}
}
2020-06-23 08:45:37 +03:00
func TestEmptyString(t *testing.T) {
if !utf8.Valid([]byte("")) {
t.Error("should be valid")
}
}