diff options
| author | Abhinav Gupta <abhinav.g90@gmail.com> | 2009-11-14 11:46:09 -0800 |
|---|---|---|
| committer | Abhinav Gupta <abhinav.g90@gmail.com> | 2009-11-14 11:46:09 -0800 |
| commit | f9496250ad7138ef6885522b116e16225cac8c8b (patch) | |
| tree | 919210b2f8fe24d1a83186d187924b6f5adea1cc /src/pkg/xml/xml_test.go | |
| parent | 5ac3824bdfca527cc84a78465e0e8c94b1522ddd (diff) | |
| download | golang-f9496250ad7138ef6885522b116e16225cac8c8b.tar.gz | |
xml: Fixed CDATA parsing.
Fixes issue 128.
R=r, rsc
http://codereview.appspot.com/154126
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/xml/xml_test.go')
| -rw-r--r-- | src/pkg/xml/xml_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pkg/xml/xml_test.go b/src/pkg/xml/xml_test.go index 058c1e765..11918428b 100644 --- a/src/pkg/xml/xml_test.go +++ b/src/pkg/xml/xml_test.go @@ -24,7 +24,7 @@ const testInput = ` <inner/> </outer> <tag:name> - Some text here. + <![CDATA[Some text here.]]> </tag:name> </body><!-- missing final newline -->` @@ -52,7 +52,9 @@ var rawTokens = []Token{ EndElement{Name{"", "outer"}}, CharData(strings.Bytes("\n ")), StartElement{Name{"tag", "name"}, nil}, - CharData(strings.Bytes("\n Some text here.\n ")), + CharData(strings.Bytes("\n ")), + CharData(strings.Bytes("Some text here.")), + CharData(strings.Bytes("\n ")), EndElement{Name{"tag", "name"}}, CharData(strings.Bytes("\n")), EndElement{Name{"", "body"}}, @@ -83,7 +85,9 @@ var cookedTokens = []Token{ EndElement{Name{"ns2", "outer"}}, CharData(strings.Bytes("\n ")), StartElement{Name{"ns3", "name"}, nil}, - CharData(strings.Bytes("\n Some text here.\n ")), + CharData(strings.Bytes("\n ")), + CharData(strings.Bytes("Some text here.")), + CharData(strings.Bytes("\n ")), EndElement{Name{"ns3", "name"}}, CharData(strings.Bytes("\n")), EndElement{Name{"ns2", "body"}}, |
