MCPcopy Create free account
hub / github.com/beevik/etree / TestEmbeddedComment

Function TestEmbeddedComment

etree_test.go:485–496  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

483}
484
485func TestEmbeddedComment(t *testing.T) {
486 s := `<a>123<!-- test -->456</a>`
487
488 doc := NewDocument()
489 err := doc.ReadFromString(s)
490 if err != nil {
491 t.Fatal("etree: incorrect ReadFromString result")
492 }
493
494 a := doc.SelectElement("a")
495 checkStrEq(t, a.Text(), "123456")
496}
497
498func TestDocumentReadHTMLEntities(t *testing.T) {
499 s := `<store>

Callers

nothing calls this directly

Calls 5

ReadFromStringMethod · 0.95
NewDocumentFunction · 0.85
checkStrEqFunction · 0.85
SelectElementMethod · 0.80
TextMethod · 0.80

Tested by

no test coverage detected