Skip to content

Commit 167554b

Browse files
committed
Improve unit testing, remove redundant code.
1 parent eb62256 commit 167554b

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

excelize_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ func TestOpenFile(t *testing.T) {
8282
xlsx.SetCellValue("Sheet2", "F14", uint32(1<<32-1))
8383
xlsx.SetCellValue("Sheet2", "F15", uint64(1<<32-1))
8484
xlsx.SetCellValue("Sheet2", "F16", true)
85+
xlsx.SetCellValue("Sheet2", "F17", complex64(5+10i))
86+
t.Log(letterOnlyMapF('x'))
87+
t.Log(deepCopy(nil, nil))
8588
// Test boolean write
8689
booltest := []struct {
8790
value bool
@@ -125,7 +128,6 @@ func TestOpenFile(t *testing.T) {
125128
if err != nil {
126129
t.Log(err)
127130
}
128-
129131
}
130132

131133
func TestAddPicture(t *testing.T) {

sheet.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,6 @@ func (f *File) setAppXML() {
193193
// library doesn't multiple namespace declarations in a single element of a
194194
// document. This function is a horrible hack to fix that after the XML
195195
// marshalling is completed.
196-
func replaceRelationshipsNameSpace(workbookMarshal string) string {
197-
oldXmlns := `<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`
198-
newXmlns := `<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main">`
199-
return strings.Replace(workbookMarshal, oldXmlns, newXmlns, -1)
200-
}
201-
202196
func replaceRelationshipsNameSpaceBytes(workbookMarshal []byte) []byte {
203197
oldXmlns := []byte(`<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">`)
204198
newXmlns := []byte(`<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main">`)

templates.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ package excelize
77
const XMLHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
88

99
var (
10+
// XMLHeaderByte define an XML declaration can also contain a standalone
11+
// declaration.
1012
XMLHeaderByte = []byte(XMLHeader)
1113
)
1214

0 commit comments

Comments
 (0)