github.com/golazy/golazy@v0.0.7-0.20221012133820-968fe65a0b65/lazyview/nodes/text_test.go (about) 1 package nodes 2 3 import ( 4 "bytes" 5 "testing" 6 ) 7 8 func TestText(t *testing.T) { 9 10 b := &bytes.Buffer{} 11 Text("<html lang=\"en\"> &").WriteTo(b) 12 13 if b.String() != "<html lang="en"> &" { 14 t.Error("expectin the text to be escaped Got:", b.String()) 15 16 } 17 18 }