MCPcopy Create free account
hub / github.com/antchfx/xmlquery / TestOutputXMLWithOptions

Function TestOutputXMLWithOptions

node_test.go:728–738  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

726}
727
728func TestOutputXMLWithOptions(t *testing.T) {
729 s := `<?xml version="1.0" encoding="utf-8"?><node><empty></empty></node>`
730 expected := `<?xml version="1.0" encoding="utf-8"?><node><empty/></node>`
731
732 doc, _ := Parse(strings.NewReader(s))
733 result := doc.OutputXMLWithOptions(WithEmptyTagSupport())
734 t.Log(result)
735 if result != expected {
736 t.Errorf("output was not expected. expected %v but got %v", expected, result)
737 }
738}
739
740func TestOutputXMLWithPreserveSpaceOption(t *testing.T) {
741 s := `<?xml version="1.0" encoding="utf-8"?>

Callers

nothing calls this directly

Calls 3

ParseFunction · 0.85
WithEmptyTagSupportFunction · 0.85
OutputXMLWithOptionsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…