diff options
author | xuri <xuri.me@gmail.com> | 2021-04-30 00:14:42 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-04-30 00:14:42 +0800 |
commit | 7e429c5b464b53f305e94cc355f14ba9e1d9849c (patch) | |
tree | c732503f48464b6303291d2538f80d170c4bc913 /lib_test.go | |
parent | af5e87dbcf5a89201072f5ca07d532258ece278f (diff) |
Fixe issue generated file corrupted caused by incorrect default XML namespace attributes
Diffstat (limited to 'lib_test.go')
-rw-r--r-- | lib_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib_test.go b/lib_test.go index f3e9b3e..10d7c3a 100644 --- a/lib_test.go +++ b/lib_test.go @@ -228,3 +228,9 @@ func TestStack(t *testing.T) { assert.Equal(t, s.Peek(), nil) assert.Equal(t, s.Pop(), nil) } + +func TestGenXMLNamespace(t *testing.T) { + assert.Equal(t, genXMLNamespace([]xml.Attr{ + {Name: xml.Name{Space: NameSpaceXML, Local: "space"}, Value: "preserve"}, + }), `xml:space="preserve">`) +} |