MCPcopy
hub / github.com/eyebluecn/tank / equalXML

Method equalXML

code/tool/webdav/xml_test.go:883–895  ·  view source on GitHub ↗

equalXML tests for equality of the normalized XML contents of a and b.

(a, b io.Reader)

Source from the content-addressed store, hash-verified

881
882// equalXML tests for equality of the normalized XML contents of a and b.
883func (n *xmlNormalizer) equalXML(a, b io.Reader) (bool, error) {
884 var buf bytes.Buffer
885 if err := n.normalize(&buf, a); err != nil {
886 return false, err
887 }
888 normA := buf.String()
889 buf.Reset()
890 if err := n.normalize(&buf, b); err != nil {
891 return false, err
892 }
893 normB := buf.String()
894 return normA == normB, nil
895}
896
897type byName []ixml.Attr
898

Callers 2

TestMultistatusWriterFunction · 0.95
TestUnmarshalXMLValueFunction · 0.95

Calls 3

normalizeMethod · 0.95
StringMethod · 0.80
ResetMethod · 0.80

Tested by

no test coverage detected