Added a quick test of XML escaping.
authorChris Jones <chris@cjones.org>
Thu, 12 Jan 2012 23:14:25 -0700
changeset 71 578c2a83dc18
parent 69 a38173c1c8b2
child 72 53f15893a1a7
Added a quick test of XML escaping.
structs_test.go
--- 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>&amp;&lt;!-- &#34;</body></message>`
+	assertMarshal(t, exp, msg)
+}