From 167554bfeca1bca54e36d761e2be159358736c9e Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 14 May 2018 10:12:46 +0800 Subject: [PATCH] Improve unit testing, remove redundant code. --- excelize_test.go | 4 +++- sheet.go | 6 ------ templates.go | 2 ++ 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/excelize_test.go b/excelize_test.go index 0ae09e5..df1b35a 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -82,6 +82,9 @@ func TestOpenFile(t *testing.T) { xlsx.SetCellValue("Sheet2", "F14", uint32(1<<32-1)) xlsx.SetCellValue("Sheet2", "F15", uint64(1<<32-1)) xlsx.SetCellValue("Sheet2", "F16", true) + xlsx.SetCellValue("Sheet2", "F17", complex64(5+10i)) + t.Log(letterOnlyMapF('x')) + t.Log(deepCopy(nil, nil)) // Test boolean write booltest := []struct { value bool @@ -125,7 +128,6 @@ func TestOpenFile(t *testing.T) { if err != nil { t.Log(err) } - } func TestAddPicture(t *testing.T) { diff --git a/sheet.go b/sheet.go index cb50d61..10a0fdb 100644 --- a/sheet.go +++ b/sheet.go @@ -193,12 +193,6 @@ func (f *File) setAppXML() { // library doesn't multiple namespace declarations in a single element of a // document. This function is a horrible hack to fix that after the XML // marshalling is completed. -func replaceRelationshipsNameSpace(workbookMarshal string) string { - oldXmlns := `` - newXmlns := `` - return strings.Replace(workbookMarshal, oldXmlns, newXmlns, -1) -} - func replaceRelationshipsNameSpaceBytes(workbookMarshal []byte) []byte { oldXmlns := []byte(``) newXmlns := []byte(``) diff --git a/templates.go b/templates.go index d3f82ee..708368e 100644 --- a/templates.go +++ b/templates.go @@ -7,6 +7,8 @@ package excelize const XMLHeader = "\n" var ( + // XMLHeaderByte define an XML declaration can also contain a standalone + // declaration. XMLHeaderByte = []byte(XMLHeader) )