github.com/Mrs4s/MiraiGo@v0.0.0-20240226124653-54bdd873e3fe/utils/string_test.go (about) 1 package utils 2 3 import ( 4 "testing" 5 ) 6 7 func TestXmlEscape(t *testing.T) { 8 input := "A \x00 terminated string." 9 expected := "A \uFFFD terminated string." 10 text := XmlEscape(input) 11 if text != expected { 12 t.Errorf("have %v, want %v", text, expected) 13 } 14 }