MCPcopy
hub / github.com/AlistGo/alist / TestEscapeTextInvalidChar

Function TestEscapeTextInvalidChar

server/webdav/internal/xml/xml_test.go:728–741  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

726}
727
728func TestEscapeTextInvalidChar(t *testing.T) {
729 input := []byte("A \x00 terminated string.")
730 expected := "A \uFFFD terminated string."
731
732 buff := new(bytes.Buffer)
733 if err := EscapeText(buff, input); err != nil {
734 t.Fatalf("have %v, want nil", err)
735 }
736 text := buff.String()
737
738 if text != expected {
739 t.Errorf("have %v, want %v", text, expected)
740 }
741}
742
743func TestIssue5880(t *testing.T) {
744 type T []byte

Callers

nothing calls this directly

Calls 2

EscapeTextFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected