diff options
author | xuri <xuri.me@gmail.com> | 2020-11-06 20:03:13 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-11-06 20:03:13 +0800 |
commit | 5dd0b4aec2931079e064f1fb393b034ce4934540 (patch) | |
tree | 118b86bc2460f46b33de4aefcce0bb0b2a768afa /sheet_test.go | |
parent | cdc57db3b3758781bd053228bfb32879b3adf3de (diff) |
using POSIX directory separator in zip path with Windows
Diffstat (limited to 'sheet_test.go')
-rw-r--r-- | sheet_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sheet_test.go b/sheet_test.go index 4626003..bfe0ce3 100644 --- a/sheet_test.go +++ b/sheet_test.go @@ -346,6 +346,19 @@ func TestSetSheetName(t *testing.T) { assert.Equal(t, "Sheet1", f.GetSheetName(0)) } +func TestGetWorkbookPath(t *testing.T) { + f := NewFile() + delete(f.XLSX, "_rels/.rels") + assert.Equal(t, "", f.getWorkbookPath()) +} + +func TestGetWorkbookRelsPath(t *testing.T) { + f := NewFile() + delete(f.XLSX, "xl/_rels/.rels") + f.XLSX["_rels/.rels"] = []byte(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument" Target="/workbook.xml"/></Relationships>`) + assert.Equal(t, "_rels/workbook.xml.rels", f.getWorkbookRelsPath()) +} + func BenchmarkNewSheet(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { |