antchfx / xmlquery

xmlquery is Golang XPath package for XML query.
https://github.com/antchfx/xpath
MIT License
444 stars 89 forks source link

Stream Parser Support - pt1 - add removeFromTree helper #33

Closed jf-tech closed 4 years ago

jf-tech commented 4 years ago

This is pt1 of adding stream parser support. See original proof-of-concept PR at https://github.com/antchfx/xmlquery/pull/32.

In the future, to update any test snapshots, simply add UPDATE_SNAPSHOTS=true env var:

UPDATE_SNAPSHOTS=true go test ./...
coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.7%) to 86.667% when pulling 83cf5b70343185bc3cfcce788c9342d124b5c365 on jf-tech:jf-tech/removenode into c43a9ea44a41141abd40cc2125be9558b5ae8763 on antchfx:master.

jf-tech commented 4 years ago

@zhengchun is the build failure something related to how your travis CI is set up?

https://travis-ci.org/github/antchfx/xmlquery/jobs/719824765

$ $HOME/gopath/bin/goveralls -service=travis-ci
exit status 1: # github.com/antchfx/xmlquery
node_test.go:10:2: cannot find package "github.com/bradleyjkemp/cupaloy" in any of:
    /home/travis/.gimme/versions/go1.9.7.linux.amd64/src/github.com/bradleyjkemp/cupaloy (from $GOROOT)
    /home/travis/gopath/src/github.com/bradleyjkemp/cupaloy (from $GOPATH)
FAIL    github.com/antchfx/xmlquery [setup failed]
jf-tech commented 4 years ago

Tried a bunch of things, still no luck. Seems 1.9x env go get doesn't support version tag:

go get github.com/bradleyjkemp/cupaloy@v2.3.0

not supported, so go get command in .travis.yml always gets the latest version. The problem is latest version of testify (v1.6.1) contains code features not available in golang 1.9x

jf-tech commented 4 years ago

All right, @zhengchun , I gave up. I'll not use testify so go1.9x is still working. However, I think you might consider doing a survey and considering dropping go 1.9 support.

zhengchun commented 4 years ago

@jf-tech , Sorry, testing failed on my machine, My Go version is v1.14.2, I am not familiar with cupaloy package, I had tried set UPDATE_SNAPSHOTS=true but go test still failed.

jf-tech commented 4 years ago

@jf-tech , Sorry, testing failed on my machine, My Go version is v1.14.2, I am not familiar with cupaloy package, I had tried set UPDATE_SNAPSHOTS=true but go test still failed.

Can you cut&paste your test error msg? No you shouldn't need to use UPDATE_SNAPSHOTS=true that's only needed when there is an actual update to the snapshot. This is my machine with go1.14.2:

$ go version
go version go1.14.2 darwin/amd64
$ go test ./...
go: downloading golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc
go: downloading github.com/antchfx/xpath v1.1.10
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: downloading golang.org/x/text v0.3.0
go: downloading github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
go: downloading github.com/davecgh/go-spew v1.1.0
go: downloading github.com/pmezard/go-difflib v1.0.0
ok      github.com/antchfx/xmlquery 0.394s
$
zhengchun commented 4 years ago

I not see the error message about which caused problem, the output is all the below message:

            +                                   "#children": []
            +                           },
            +                           {
            +                                   "Parent": "ptr:(ELEM aaa)",
            +                                   "FirstChild": "ptr:(nil)",
            +                                   "LastChild": "ptr:(nil)",
            +                                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +                                   "NextSibling": "ptr:(nil)",
            +                                   "Type": "ElementNode",
            +                                   "Data": "ggg",
            +                                   "Prefix": "",
            +                                   "NamespaceURI": "",
            +                                   "Attr": [],
            +                                   "Level": 2,
            +                                   "#children": []
            +                           }
            +                   ]
            +           }
            +   ]
            +}

            +

FAIL
exit status 1
FAIL    github.com/antchfx/xmlquery     9.644s

It is a lot of similar message in my output windows.

jf-tech commented 4 years ago

Wait, is your machine Windows or Mac OS? Which repo and branch you checked out and git fetched? Do you see a dir named .snapshots:

$ ls -lah
total 84K
drwxr-xr-x 17 staff  544 Aug 22 10:37 ./
drwxr-xr-x  7 staff  224 Aug 19 09:24 ../
drwxr-xr-x 16 staff  512 Aug 22 10:49 .git/
drwxr-xr-x  7 staff  224 Aug 21 16:21 .snapshots/
-rw-r--r--  1 staff  306 Aug 19 09:24 .gitignore
-rw-r--r--  1 staff  317 Aug 22 10:07 .travis.yml
-rw-r--r--  1 staff 1022 Aug 19 09:24 LICENSE
-rw-r--r--  1 staff 5.8K Aug 19 09:24 README.md
-rw-r--r--  1 staff 4.4K Aug 19 09:24 books.xml
-rw-r--r--  1 staff  914 Aug 19 09:24 cache.go
-rw-r--r--  1 staff  359 Aug 22 10:37 go.mod
-rw-r--r--  1 staff 2.0K Aug 22 10:37 go.sum
-rw-r--r--  1 staff 3.1K Aug 22 10:45 marshal_test.go
-rw-r--r--  1 staff 8.4K Aug 21 15:48 node.go
-rw-r--r--  1 staff  16K Aug 22 10:37 node_test.go
-rw-r--r--  1 staff 6.4K Aug 19 09:24 query.go
-rw-r--r--  1 staff 3.5K Aug 19 09:24 query_test.go

The .snapshots dir should have these files:

├── .snapshots
│   ├── TestRemove-remove_a_node_that_is_neither_the_first_nor__the_last_child_of_its_parent
│   ├── TestRemove-remove_a_node_that_is_the_first_but_not_the_last_child_of_its_parent
│   ├── TestRemove-remove_a_node_that_is_the_last_but_not_the_first_child_of_its_parent
│   ├── TestRemove-remove_a_node_that_is_the_only_child_of_its_parent
│   └── TestRemove-remove_on_a_root_does_nothing
zhengchun commented 4 years ago

I am using windows 10, I had the .snapshots folder in my project root. I checkout this PR #33 (a360535dbd71faadf43887a40222209208443b81) as my branch.

jf-tech commented 4 years ago

Can u share the full error msg?

zhengchun commented 4 years ago
--- FAIL: TestRemove (0.01s)
    --- FAIL: TestRemove/remove_a_node_that_is_the_only_child_of_its_parent (0.00s)
        node_test.go:137: snapshot not equal:
            --- Previous
            +++ Current
            @@ -1,259 +1,259 @@
            -{
            -   "Parent": "ptr:(nil)",
            -   "FirstChild": "ptr:(DECL 'xml')",
            -   "LastChild": "ptr:(ELEM aaa)",
            -   "PrevSibling": "ptr:(nil)",
            -   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -   "Type": "DocumentNode",
            -   "Data": "",
            -   "Prefix": "",
            -   "NamespaceURI": "",
            -   "Attr": null,
            -   "Level": 0,
            -   "#children": [
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(nil)",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "version"
            -                   },
            -                   "Value": "1.0"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "encoding"
            -                   },
            -                   "Value": "UTF-8"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml')",
            -           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml-stylesheet",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "type"
            -                   },
            -                   "Value": "text/xsl"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "href"
            -                   },
            -                   "Value": "style.xsl"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "NextSibling": "ptr:(COMMENT ' root comment here')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "CommentNode",
            -           "Data": " root comment here",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            -           "NextSibling": "ptr:(ELEM aaa)",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(ELEM bbb)",
            -           "LastChild": "ptr:(ELEM ggg)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(nil)",
            -           "Type": "ElementNode",
            -           "Data": "aaa",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [],
            -           "Level": 1,
            -           "#children": [
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            -                   "PrevSibling": "ptr:(nil)",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "bbb",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(ELEM ccc)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                           "Type": "ElementNode",
            -                           "Data": "ccc",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(ELEM ccc)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM bbb)",
            -                   "NextSibling": "ptr:(ELEM ddd)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "ddd",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM ddd)",
            -                   "NextSibling": "ptr:(ELEM ggg)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -                   "NextSibling": "ptr:(nil)",
            -                   "Type": "ElementNode",
            -                   "Data": "ggg",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": []
            -               }
            -           ]
            -       }
            -   ]
            -}
            -
            +{
            +   "Parent": "ptr:(nil)",
            +   "FirstChild": "ptr:(DECL 'xml')",
            +   "LastChild": "ptr:(ELEM aaa)",
            +   "PrevSibling": "ptr:(nil)",
            +   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +   "Type": "DocumentNode",
            +   "Data": "",
            +   "Prefix": "",
            +   "NamespaceURI": "",
            +   "Attr": null,
            +   "Level": 0,
            +   "#children": [
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(nil)",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "version"
            +                   },
            +                   "Value": "1.0"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "encoding"
            +                   },
            +                   "Value": "UTF-8"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml')",
            +           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml-stylesheet",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "type"
            +                   },
            +                   "Value": "text/xsl"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "href"
            +                   },
            +                   "Value": "style.xsl"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "NextSibling": "ptr:(COMMENT ' root comment here')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "CommentNode",
            +           "Data": " root comment here",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            +           "NextSibling": "ptr:(ELEM aaa)",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(ELEM bbb)",
            +           "LastChild": "ptr:(ELEM ggg)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(nil)",
            +           "Type": "ElementNode",
            +           "Data": "aaa",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [],
            +           "Level": 1,
            +           "#children": [
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            +                   "PrevSibling": "ptr:(nil)",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "bbb",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(ELEM ccc)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                           "Type": "ElementNode",
            +                           "Data": "ccc",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(ELEM ccc)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM bbb)",
            +                   "NextSibling": "ptr:(ELEM ddd)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "ddd",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM ddd)",
            +                   "NextSibling": "ptr:(ELEM ggg)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +                   "NextSibling": "ptr:(nil)",
            +                   "Type": "ElementNode",
            +                   "Data": "ggg",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": []
            +               }
            +           ]
            +       }
            +   ]
            +}

            +

    --- FAIL: TestRemove/remove_a_node_that_is_the_first_but_not_the_last_child_of_its_parent (0.00s)
        node_test.go:146: snapshot not equal:
            --- Previous
            +++ Current
            @@ -1,232 +1,232 @@
            -{
            -   "Parent": "ptr:(nil)",
            -   "FirstChild": "ptr:(DECL 'xml')",
            -   "LastChild": "ptr:(ELEM aaa)",
            -   "PrevSibling": "ptr:(nil)",
            -   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -   "Type": "DocumentNode",
            -   "Data": "",
            -   "Prefix": "",
            -   "NamespaceURI": "",
            -   "Attr": null,
            -   "Level": 0,
            -   "#children": [
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(nil)",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "version"
            -                   },
            -                   "Value": "1.0"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "encoding"
            -                   },
            -                   "Value": "UTF-8"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml')",
            -           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml-stylesheet",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "type"
            -                   },
            -                   "Value": "text/xsl"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "href"
            -                   },
            -                   "Value": "style.xsl"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "NextSibling": "ptr:(COMMENT ' root comment here')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "CommentNode",
            -           "Data": " root comment here",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            -           "NextSibling": "ptr:(ELEM aaa)",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(CDATA '\n\t\t\t')",
            -           "LastChild": "ptr:(ELEM ggg)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(nil)",
            -           "Type": "ElementNode",
            -           "Data": "aaa",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [],
            -           "Level": 1,
            -           "#children": [
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(nil)",
            -                   "NextSibling": "ptr:(ELEM ddd)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(ELEM eee)",
            -                   "LastChild": "ptr:(ELEM eee)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "ddd",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM ddd)",
            -                           "FirstChild": "ptr:(ELEM fff)",
            -                           "LastChild": "ptr:(ELEM fff)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "ElementNode",
            -                           "Data": "eee",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": [
            -                               {
            -                                   "Parent": "ptr:(ELEM eee)",
            -                                   "FirstChild": "ptr:(nil)",
            -                                   "LastChild": "ptr:(nil)",
            -                                   "PrevSibling": "ptr:(nil)",
            -                                   "NextSibling": "ptr:(nil)",
            -                                   "Type": "ElementNode",
            -                                   "Data": "fff",
            -                                   "Prefix": "",
            -                                   "NamespaceURI": "",
            -                                   "Attr": [],
            -                                   "Level": 4,
            -                                   "#children": []
            -                               }
            -                           ]
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM ddd)",
            -                   "NextSibling": "ptr:(ELEM ggg)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -                   "NextSibling": "ptr:(nil)",
            -                   "Type": "ElementNode",
            -                   "Data": "ggg",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": []
            -               }
            -           ]
            -       }
            -   ]
            -}
            -
            +{
            +   "Parent": "ptr:(nil)",
            +   "FirstChild": "ptr:(DECL 'xml')",
            +   "LastChild": "ptr:(ELEM aaa)",
            +   "PrevSibling": "ptr:(nil)",
            +   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +   "Type": "DocumentNode",
            +   "Data": "",
            +   "Prefix": "",
            +   "NamespaceURI": "",
            +   "Attr": null,
            +   "Level": 0,
            +   "#children": [
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(nil)",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "version"
            +                   },
            +                   "Value": "1.0"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "encoding"
            +                   },
            +                   "Value": "UTF-8"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml')",
            +           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml-stylesheet",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "type"
            +                   },
            +                   "Value": "text/xsl"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "href"
            +                   },
            +                   "Value": "style.xsl"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "NextSibling": "ptr:(COMMENT ' root comment here')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "CommentNode",
            +           "Data": " root comment here",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            +           "NextSibling": "ptr:(ELEM aaa)",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(CDATA '\n\t\t\t')",
            +           "LastChild": "ptr:(ELEM ggg)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(nil)",
            +           "Type": "ElementNode",
            +           "Data": "aaa",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [],
            +           "Level": 1,
            +           "#children": [
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(nil)",
            +                   "NextSibling": "ptr:(ELEM ddd)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(ELEM eee)",
            +                   "LastChild": "ptr:(ELEM eee)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "ddd",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM ddd)",
            +                           "FirstChild": "ptr:(ELEM fff)",
            +                           "LastChild": "ptr:(ELEM fff)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "ElementNode",
            +                           "Data": "eee",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": [
            +                               {
            +                                   "Parent": "ptr:(ELEM eee)",
            +                                   "FirstChild": "ptr:(nil)",
            +                                   "LastChild": "ptr:(nil)",
            +                                   "PrevSibling": "ptr:(nil)",
            +                                   "NextSibling": "ptr:(nil)",
            +                                   "Type": "ElementNode",
            +                                   "Data": "fff",
            +                                   "Prefix": "",
            +                                   "NamespaceURI": "",
            +                                   "Attr": [],
            +                                   "Level": 4,
            +                                   "#children": []
            +                               }
            +                           ]
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM ddd)",
            +                   "NextSibling": "ptr:(ELEM ggg)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +                   "NextSibling": "ptr:(nil)",
            +                   "Type": "ElementNode",
            +                   "Data": "ggg",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": []
            +               }
            +           ]
            +       }
            +   ]
            +}

            +

    --- FAIL: TestRemove/remove_a_node_that_is_neither_the_first_nor__the_last_child_of_its_parent (0.00s)
        node_test.go:155: snapshot not equal:
            --- Previous
            +++ Current
            @@ -1,245 +1,245 @@
            -{
            -   "Parent": "ptr:(nil)",
            -   "FirstChild": "ptr:(DECL 'xml')",
            -   "LastChild": "ptr:(ELEM aaa)",
            -   "PrevSibling": "ptr:(nil)",
            -   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -   "Type": "DocumentNode",
            -   "Data": "",
            -   "Prefix": "",
            -   "NamespaceURI": "",
            -   "Attr": null,
            -   "Level": 0,
            -   "#children": [
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(nil)",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "version"
            -                   },
            -                   "Value": "1.0"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "encoding"
            -                   },
            -                   "Value": "UTF-8"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml')",
            -           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml-stylesheet",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "type"
            -                   },
            -                   "Value": "text/xsl"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "href"
            -                   },
            -                   "Value": "style.xsl"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "NextSibling": "ptr:(COMMENT ' root comment here')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "CommentNode",
            -           "Data": " root comment here",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            -           "NextSibling": "ptr:(ELEM aaa)",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(ELEM bbb)",
            -           "LastChild": "ptr:(ELEM ggg)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(nil)",
            -           "Type": "ElementNode",
            -           "Data": "aaa",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [],
            -           "Level": 1,
            -           "#children": [
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            -                   "PrevSibling": "ptr:(nil)",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "bbb",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(ELEM ccc)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                           "Type": "ElementNode",
            -                           "Data": "ccc",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(ELEM ccc)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM bbb)",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "NextSibling": "ptr:(ELEM ggg)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -                   "NextSibling": "ptr:(nil)",
            -                   "Type": "ElementNode",
            -                   "Data": "ggg",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": []
            -               }
            -           ]
            -       }
            -   ]
            -}
            -
            +{
            +   "Parent": "ptr:(nil)",
            +   "FirstChild": "ptr:(DECL 'xml')",
            +   "LastChild": "ptr:(ELEM aaa)",
            +   "PrevSibling": "ptr:(nil)",
            +   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +   "Type": "DocumentNode",
            +   "Data": "",
            +   "Prefix": "",
            +   "NamespaceURI": "",
            +   "Attr": null,
            +   "Level": 0,
            +   "#children": [
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(nil)",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "version"
            +                   },
            +                   "Value": "1.0"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "encoding"
            +                   },
            +                   "Value": "UTF-8"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml')",
            +           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml-stylesheet",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "type"
            +                   },
            +                   "Value": "text/xsl"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "href"
            +                   },
            +                   "Value": "style.xsl"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "NextSibling": "ptr:(COMMENT ' root comment here')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "CommentNode",
            +           "Data": " root comment here",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            +           "NextSibling": "ptr:(ELEM aaa)",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(ELEM bbb)",
            +           "LastChild": "ptr:(ELEM ggg)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(nil)",
            +           "Type": "ElementNode",
            +           "Data": "aaa",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [],
            +           "Level": 1,
            +           "#children": [
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            +                   "PrevSibling": "ptr:(nil)",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "bbb",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(ELEM ccc)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                           "Type": "ElementNode",
            +                           "Data": "ccc",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(ELEM ccc)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM bbb)",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "NextSibling": "ptr:(ELEM ggg)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +                   "NextSibling": "ptr:(nil)",
            +                   "Type": "ElementNode",
            +                   "Data": "ggg",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": []
            +               }
            +           ]
            +       }
            +   ]
            +}

            +

    --- FAIL: TestRemove/remove_a_node_that_is_the_last_but_not_the_first_child_of_its_parent (0.00s)
        node_test.go:164: snapshot not equal:
            --- Previous
            +++ Current
            @@ -1,275 +1,275 @@
            -{
            -   "Parent": "ptr:(nil)",
            -   "FirstChild": "ptr:(DECL 'xml')",
            -   "LastChild": "ptr:(ELEM aaa)",
            -   "PrevSibling": "ptr:(nil)",
            -   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -   "Type": "DocumentNode",
            -   "Data": "",
            -   "Prefix": "",
            -   "NamespaceURI": "",
            -   "Attr": null,
            -   "Level": 0,
            -   "#children": [
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(nil)",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "version"
            -                   },
            -                   "Value": "1.0"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "encoding"
            -                   },
            -                   "Value": "UTF-8"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml')",
            -           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml-stylesheet",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "type"
            -                   },
            -                   "Value": "text/xsl"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "href"
            -                   },
            -                   "Value": "style.xsl"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "NextSibling": "ptr:(COMMENT ' root comment here')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "CommentNode",
            -           "Data": " root comment here",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            -           "NextSibling": "ptr:(ELEM aaa)",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(ELEM bbb)",
            -           "LastChild": "ptr:(CDATA '\n\t\t')",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(nil)",
            -           "Type": "ElementNode",
            -           "Data": "aaa",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [],
            -           "Level": 1,
            -           "#children": [
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            -                   "PrevSibling": "ptr:(nil)",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "bbb",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(ELEM ccc)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                           "Type": "ElementNode",
            -                           "Data": "ccc",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(ELEM ccc)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM bbb)",
            -                   "NextSibling": "ptr:(ELEM ddd)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(ELEM eee)",
            -                   "LastChild": "ptr:(ELEM eee)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "ddd",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM ddd)",
            -                           "FirstChild": "ptr:(ELEM fff)",
            -                           "LastChild": "ptr:(ELEM fff)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "ElementNode",
            -                           "Data": "eee",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": [
            -                               {
            -                                   "Parent": "ptr:(ELEM eee)",
            -                                   "FirstChild": "ptr:(nil)",
            -                                   "LastChild": "ptr:(nil)",
            -                                   "PrevSibling": "ptr:(nil)",
            -                                   "NextSibling": "ptr:(nil)",
            -                                   "Type": "ElementNode",
            -                                   "Data": "fff",
            -                                   "Prefix": "",
            -                                   "NamespaceURI": "",
            -                                   "Attr": [],
            -                                   "Level": 4,
            -                                   "#children": []
            -                               }
            -                           ]
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM ddd)",
            -                   "NextSibling": "ptr:(nil)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               }
            -           ]
            -       }
            -   ]
            -}
            -
            +{
            +   "Parent": "ptr:(nil)",
            +   "FirstChild": "ptr:(DECL 'xml')",
            +   "LastChild": "ptr:(ELEM aaa)",
            +   "PrevSibling": "ptr:(nil)",
            +   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +   "Type": "DocumentNode",
            +   "Data": "",
            +   "Prefix": "",
            +   "NamespaceURI": "",
            +   "Attr": null,
            +   "Level": 0,
            +   "#children": [
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(nil)",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "version"
            +                   },
            +                   "Value": "1.0"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "encoding"
            +                   },
            +                   "Value": "UTF-8"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml')",
            +           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml-stylesheet",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "type"
            +                   },
            +                   "Value": "text/xsl"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "href"
            +                   },
            +                   "Value": "style.xsl"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "NextSibling": "ptr:(COMMENT ' root comment here')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "CommentNode",
            +           "Data": " root comment here",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            +           "NextSibling": "ptr:(ELEM aaa)",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(ELEM bbb)",
            +           "LastChild": "ptr:(CDATA '\n\t\t')",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(nil)",
            +           "Type": "ElementNode",
            +           "Data": "aaa",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [],
            +           "Level": 1,
            +           "#children": [
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            +                   "PrevSibling": "ptr:(nil)",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "bbb",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(ELEM ccc)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                           "Type": "ElementNode",
            +                           "Data": "ccc",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(ELEM ccc)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM bbb)",
            +                   "NextSibling": "ptr:(ELEM ddd)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(ELEM eee)",
            +                   "LastChild": "ptr:(ELEM eee)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "ddd",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM ddd)",
            +                           "FirstChild": "ptr:(ELEM fff)",
            +                           "LastChild": "ptr:(ELEM fff)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "ElementNode",
            +                           "Data": "eee",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": [
            +                               {
            +                                   "Parent": "ptr:(ELEM eee)",
            +                                   "FirstChild": "ptr:(nil)",
            +                                   "LastChild": "ptr:(nil)",
            +                                   "PrevSibling": "ptr:(nil)",
            +                                   "NextSibling": "ptr:(nil)",
            +                                   "Type": "ElementNode",
            +                                   "Data": "fff",
            +                                   "Prefix": "",
            +                                   "NamespaceURI": "",
            +                                   "Attr": [],
            +                                   "Level": 4,
            +                                   "#children": []
            +                               }
            +                           ]
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM ddd)",
            +                   "NextSibling": "ptr:(nil)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               }
            +           ]
            +       }
            +   ]
            +}

            +

    --- FAIL: TestRemove/remove_on_a_root_does_nothing (0.00s)
        node_test.go:171: snapshot not equal:
            --- Previous
            +++ Current
            @@ -1,289 +1,289 @@
            -{
            -   "Parent": "ptr:(nil)",
            -   "FirstChild": "ptr:(DECL 'xml')",
            -   "LastChild": "ptr:(ELEM aaa)",
            -   "PrevSibling": "ptr:(nil)",
            -   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -   "Type": "DocumentNode",
            -   "Data": "",
            -   "Prefix": "",
            -   "NamespaceURI": "",
            -   "Attr": null,
            -   "Level": 0,
            -   "#children": [
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(nil)",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "version"
            -                   },
            -                   "Value": "1.0"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "encoding"
            -                   },
            -                   "Value": "UTF-8"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml')",
            -           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "DeclarationNode",
            -           "Data": "xml-stylesheet",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "type"
            -                   },
            -                   "Value": "text/xsl"
            -               },
            -               {
            -                   "Name": {
            -                       "Space": "",
            -                       "Local": "href"
            -                   },
            -                   "Value": "style.xsl"
            -               }
            -           ],
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            -           "NextSibling": "ptr:(COMMENT ' root comment here')",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(CDATA '\n\t\t')",
            -           "Type": "CommentNode",
            -           "Data": " root comment here",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(nil)",
            -           "LastChild": "ptr:(nil)",
            -           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            -           "NextSibling": "ptr:(ELEM aaa)",
            -           "Type": "CharDataNode",
            -           "Data": "\n\t\t",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": null,
            -           "Level": 1,
            -           "#children": []
            -       },
            -       {
            -           "Parent": "ptr:(ROOT)",
            -           "FirstChild": "ptr:(ELEM bbb)",
            -           "LastChild": "ptr:(ELEM ggg)",
            -           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -           "NextSibling": "ptr:(nil)",
            -           "Type": "ElementNode",
            -           "Data": "aaa",
            -           "Prefix": "",
            -           "NamespaceURI": "",
            -           "Attr": [],
            -           "Level": 1,
            -           "#children": [
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            -                   "PrevSibling": "ptr:(nil)",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "bbb",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(ELEM ccc)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            -                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            -                           "Type": "ElementNode",
            -                           "Data": "ccc",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": []
            -                       },
            -                       {
            -                           "Parent": "ptr:(ELEM bbb)",
            -                           "FirstChild": "ptr:(nil)",
            -                           "LastChild": "ptr:(nil)",
            -                           "PrevSibling": "ptr:(ELEM ccc)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "CharDataNode",
            -                           "Data": "\n\t\t\t",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": null,
            -                           "Level": 3,
            -                           "#children": []
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM bbb)",
            -                   "NextSibling": "ptr:(ELEM ddd)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(ELEM eee)",
            -                   "LastChild": "ptr:(ELEM eee)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            -                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            -                   "Type": "ElementNode",
            -                   "Data": "ddd",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": [
            -                       {
            -                           "Parent": "ptr:(ELEM ddd)",
            -                           "FirstChild": "ptr:(ELEM fff)",
            -                           "LastChild": "ptr:(ELEM fff)",
            -                           "PrevSibling": "ptr:(nil)",
            -                           "NextSibling": "ptr:(nil)",
            -                           "Type": "ElementNode",
            -                           "Data": "eee",
            -                           "Prefix": "",
            -                           "NamespaceURI": "",
            -                           "Attr": [],
            -                           "Level": 3,
            -                           "#children": [
            -                               {
            -                                   "Parent": "ptr:(ELEM eee)",
            -                                   "FirstChild": "ptr:(nil)",
            -                                   "LastChild": "ptr:(nil)",
            -                                   "PrevSibling": "ptr:(nil)",
            -                                   "NextSibling": "ptr:(nil)",
            -                                   "Type": "ElementNode",
            -                                   "Data": "fff",
            -                                   "Prefix": "",
            -                                   "NamespaceURI": "",
            -                                   "Attr": [],
            -                                   "Level": 4,
            -                                   "#children": []
            -                               }
            -                           ]
            -                       }
            -                   ]
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(ELEM ddd)",
            -                   "NextSibling": "ptr:(ELEM ggg)",
            -                   "Type": "CharDataNode",
            -                   "Data": "\n\t\t",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": null,
            -                   "Level": 2,
            -                   "#children": []
            -               },
            -               {
            -                   "Parent": "ptr:(ELEM aaa)",
            -                   "FirstChild": "ptr:(nil)",
            -                   "LastChild": "ptr:(nil)",
            -                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            -                   "NextSibling": "ptr:(nil)",
            -                   "Type": "ElementNode",
            -                   "Data": "ggg",
            -                   "Prefix": "",
            -                   "NamespaceURI": "",
            -                   "Attr": [],
            -                   "Level": 2,
            -                   "#children": []
            -               }
            -           ]
            -       }
            -   ]
            -}
            -
            +{
            +   "Parent": "ptr:(nil)",
            +   "FirstChild": "ptr:(DECL 'xml')",
            +   "LastChild": "ptr:(ELEM aaa)",
            +   "PrevSibling": "ptr:(nil)",
            +   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +   "Type": "DocumentNode",
            +   "Data": "",
            +   "Prefix": "",
            +   "NamespaceURI": "",
            +   "Attr": null,
            +   "Level": 0,
            +   "#children": [
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(nil)",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "version"
            +                   },
            +                   "Value": "1.0"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "encoding"
            +                   },
            +                   "Value": "UTF-8"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml')",
            +           "NextSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "DeclarationNode",
            +           "Data": "xml-stylesheet",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "type"
            +                   },
            +                   "Value": "text/xsl"
            +               },
            +               {
            +                   "Name": {
            +                       "Space": "",
            +                       "Local": "href"
            +                   },
            +                   "Value": "style.xsl"
            +               }
            +           ],
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(DECL 'xml-stylesheet')",
            +           "NextSibling": "ptr:(COMMENT ' root comment here')",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(CDATA '\n\t\t')",
            +           "Type": "CommentNode",
            +           "Data": " root comment here",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(nil)",
            +           "LastChild": "ptr:(nil)",
            +           "PrevSibling": "ptr:(COMMENT ' root comment here')",
            +           "NextSibling": "ptr:(ELEM aaa)",
            +           "Type": "CharDataNode",
            +           "Data": "\n\t\t",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": null,
            +           "Level": 1,
            +           "#children": []
            +       },
            +       {
            +           "Parent": "ptr:(ROOT)",
            +           "FirstChild": "ptr:(ELEM bbb)",
            +           "LastChild": "ptr:(ELEM ggg)",
            +           "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +           "NextSibling": "ptr:(nil)",
            +           "Type": "ElementNode",
            +           "Data": "aaa",
            +           "Prefix": "",
            +           "NamespaceURI": "",
            +           "Attr": [],
            +           "Level": 1,
            +           "#children": [
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                   "LastChild": "ptr:(CDATA '\n\t\t\t')",
            +                   "PrevSibling": "ptr:(nil)",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "bbb",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(ELEM ccc)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t\tbbb child text\n\t\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(CDATA '\n\t\t\t\tbbb child text\n\t\t\t\t')",
            +                           "NextSibling": "ptr:(CDATA '\n\t\t\t')",
            +                           "Type": "ElementNode",
            +                           "Data": "ccc",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": []
            +                       },
            +                       {
            +                           "Parent": "ptr:(ELEM bbb)",
            +                           "FirstChild": "ptr:(nil)",
            +                           "LastChild": "ptr:(nil)",
            +                           "PrevSibling": "ptr:(ELEM ccc)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "CharDataNode",
            +                           "Data": "\n\t\t\t",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": null,
            +                           "Level": 3,
            +                           "#children": []
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM bbb)",
            +                   "NextSibling": "ptr:(ELEM ddd)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(ELEM eee)",
            +                   "LastChild": "ptr:(ELEM eee)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t\t')",
            +                   "NextSibling": "ptr:(CDATA '\n\t\t')",
            +                   "Type": "ElementNode",
            +                   "Data": "ddd",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": [
            +                       {
            +                           "Parent": "ptr:(ELEM ddd)",
            +                           "FirstChild": "ptr:(ELEM fff)",
            +                           "LastChild": "ptr:(ELEM fff)",
            +                           "PrevSibling": "ptr:(nil)",
            +                           "NextSibling": "ptr:(nil)",
            +                           "Type": "ElementNode",
            +                           "Data": "eee",
            +                           "Prefix": "",
            +                           "NamespaceURI": "",
            +                           "Attr": [],
            +                           "Level": 3,
            +                           "#children": [
            +                               {
            +                                   "Parent": "ptr:(ELEM eee)",
            +                                   "FirstChild": "ptr:(nil)",
            +                                   "LastChild": "ptr:(nil)",
            +                                   "PrevSibling": "ptr:(nil)",
            +                                   "NextSibling": "ptr:(nil)",
            +                                   "Type": "ElementNode",
            +                                   "Data": "fff",
            +                                   "Prefix": "",
            +                                   "NamespaceURI": "",
            +                                   "Attr": [],
            +                                   "Level": 4,
            +                                   "#children": []
            +                               }
            +                           ]
            +                       }
            +                   ]
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(ELEM ddd)",
            +                   "NextSibling": "ptr:(ELEM ggg)",
            +                   "Type": "CharDataNode",
            +                   "Data": "\n\t\t",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": null,
            +                   "Level": 2,
            +                   "#children": []
            +               },
            +               {
            +                   "Parent": "ptr:(ELEM aaa)",
            +                   "FirstChild": "ptr:(nil)",
            +                   "LastChild": "ptr:(nil)",
            +                   "PrevSibling": "ptr:(CDATA '\n\t\t')",
            +                   "NextSibling": "ptr:(nil)",
            +                   "Type": "ElementNode",
            +                   "Data": "ggg",
            +                   "Prefix": "",
            +                   "NamespaceURI": "",
            +                   "Attr": [],
            +                   "Level": 2,
            +                   "#children": []
            +               }
            +           ]
            +       }
            +   ]
            +}

            +

FAIL
exit status 1
FAIL    github.com/antchfx/xmlquery 0.308s
jf-tech commented 4 years ago

Hm... @zhengchun It's a bit strange: I compared the printed text from your cut&paste above, seems like the - Previous vs + Curent are identical. I'm suspecting because it's due to OS (mac/linux vs Windows) different treatment about "\n" (where on Mac/Linux "\n" is written out as LF (ASCII code: 0A) whereas on Windows, "\n" is written out as CR LF (ASCII code: 0D 0A).

Can you run the tests again:

UPDATE_SNAPSHOTS=true go test ./...

And after that, git status to see if any of the snapshot files are updated or not.

Sorry for the trouble and thx for the patience. Snapshot testing is really useful, want to get it right. But honestly never encountered Windows dev machine before :)

zhengchun commented 4 years ago

Thanks, Testing passed after update snapshots. There is a little problem, The Snapshot files cannot compatibility with windows and linux.

jf-tech commented 4 years ago

@zhengchun given cupaloy incompatibility between (mac,linux) vs windows, dropping snapshot testing support :(

I'll raise an issue with cupaloy but it doesn't seem to have active delopment. I've also raised suggestions to testify which is popular and in active development. Hopefully testify can add snapshot support soon.

It is what it is. Please take a look. Thx!

zhengchun commented 4 years ago

Merged. We will add snapshot for testing when they are available.