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

Function TestProcessingInstructionStructure

parse_test.go:727–753  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

725}
726
727func TestProcessingInstructionStructure(t *testing.T) {
728 t.Run("Document1", func(t *testing.T) {
729 xml := `<?xml version="1.0" encoding="UTF-8"?><item><para>first</para><?xe-change-remove-start?><item><para>second</para></item></item>`
730 doc, err := Parse(strings.NewReader(xml))
731 if err != nil {
732 t.Fatalf("Failed to parse document1: %v", err)
733 }
734
735 output := doc.OutputXML(false)
736 if output != xml {
737 t.Errorf("Document1 output mismatch:\nExpected: %s\nGot: %s", xml, output)
738 }
739 })
740
741 t.Run("Document2", func(t *testing.T) {
742 xml := `<?xml version="1.0" encoding="UTF-8"?><list><item><para><?xe-change-remove-start?></para></item></list>`
743 doc, err := Parse(strings.NewReader(xml))
744 if err != nil {
745 t.Fatalf("Failed to parse document2: %v", err)
746 }
747
748 output := doc.OutputXML(false)
749 if output != xml {
750 t.Errorf("Document2 output mismatch:\nExpected: %s\nGot: %s", xml, output)
751 }
752 })
753}

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.85
OutputXMLMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…