From 13e7bce6d22bd8989084f34280fffcefef7ad9b7 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 20 Jul 2020 00:05:37 +0800 Subject: improvement compatibility for the XML ignorable namespace --- lib_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib_test.go') diff --git a/lib_test.go b/lib_test.go index e4ccdcc..f3e9b3e 100644 --- a/lib_test.go +++ b/lib_test.go @@ -1,6 +1,7 @@ package excelize import ( + "encoding/xml" "fmt" "strconv" "strings" @@ -215,6 +216,13 @@ func TestBytesReplace(t *testing.T) { assert.EqualValues(t, s, bytesReplace(s, []byte{}, []byte{}, 0)) } +func TestSetIgnorableNameSpace(t *testing.T) { + f := NewFile() + f.xmlAttr["xml_path"] = []xml.Attr{{}} + f.setIgnorableNameSpace("xml_path", 0, xml.Attr{Name: xml.Name{Local: "c14"}}) + assert.EqualValues(t, "c14", f.xmlAttr["xml_path"][0].Value) +} + func TestStack(t *testing.T) { s := NewStack() assert.Equal(t, s.Peek(), nil) -- cgit v1.2.1