diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-26 14:53:25 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-26 14:53:25 +0000 |
commit | 9e1b949cce0f9ef70dcd4afbe5868e0d95df1281 (patch) | |
tree | 137b86fc61b9e2f6e640c75c064cffb9b909e79a /libgo/go/html/parse_test.go | |
parent | 9b040c42465165aa265b581d597878f799c29ad0 (diff) | |
download | gcc-9e1b949cce0f9ef70dcd4afbe5868e0d95df1281.tar.gz |
2012-01-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 183561 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@183563 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/html/parse_test.go')
-rw-r--r-- | libgo/go/html/parse_test.go | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libgo/go/html/parse_test.go b/libgo/go/html/parse_test.go index 015b5838f0b..1528dffaafa 100644 --- a/libgo/go/html/parse_test.go +++ b/libgo/go/html/parse_test.go @@ -103,10 +103,21 @@ func dumpLevel(w io.Writer, n *Node, level int) error { } else { fmt.Fprintf(w, "<%s>", n.Data) } - for _, a := range n.Attr { + attr := n.Attr + if len(attr) == 2 && attr[0].Namespace == "xml" && attr[1].Namespace == "xlink" { + // Some of the test cases in tests10.dat change the order of adjusted + // foreign attributes, but that behavior is not in the spec, and could + // simply be an implementation detail of html5lib's python map ordering. + attr[0], attr[1] = attr[1], attr[0] + } + for _, a := range attr { io.WriteString(w, "\n") dumpIndent(w, level+1) - fmt.Fprintf(w, `%s="%s"`, a.Key, a.Val) + if a.Namespace != "" { + fmt.Fprintf(w, `%s %s="%s"`, a.Namespace, a.Key, a.Val) + } else { + fmt.Fprintf(w, `%s="%s"`, a.Key, a.Val) + } } case TextNode: fmt.Fprintf(w, `"%s"`, n.Data) @@ -172,8 +183,8 @@ func TestParser(t *testing.T) { {"tests3.dat", -1}, {"tests4.dat", -1}, {"tests5.dat", -1}, - {"tests6.dat", 47}, - {"tests10.dat", 16}, + {"tests6.dat", -1}, + {"tests10.dat", 35}, } for _, tf := range testFiles { f, err := os.Open("testdata/webkit/" + tf.filename) |