author | Chris Jones <chris@cjones.org> |
Thu, 12 Jan 2012 23:14:25 -0700 | |
changeset 71 | 578c2a83dc18 |
parent 69 | a38173c1c8b2 |
child 72 | 53f15893a1a7 |
structs_test.go | file | annotate | diff | comparison | revisions |
--- a/structs_test.go Sun Jan 08 13:04:09 2012 -0700 +++ b/structs_test.go Thu Jan 12 23:14:25 2012 -0700 @@ -136,3 +136,10 @@ } assertEquals(t, "presence", st.GetName()) } + +func TestMarshalEscaping(t *testing.T) { + msg := &Message{Body: &Generic{XMLName: xml.Name{Local: "body"}, + Chardata: `&<!-- "`}} + exp := `<message><body>&<!-- "</body></message>` + assertMarshal(t, exp, msg) +}