diff options
author | xuri <xuri.me@gmail.com> | 2022-09-08 22:20:21 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2022-09-08 22:20:21 +0800 |
commit | fb1aab7add52808c96c9cc10570fe73ce797b7f4 (patch) | |
tree | 778202a8944ecad3c7f74edf4f9ac4b0a150f79d /file_test.go | |
parent | 0c5cdfec1868f31f6e355cdcb0a91220bad80522 (diff) |
This closes #744, the `Save`, `Write` and `WriteTo` function accept saving options
Diffstat (limited to 'file_test.go')
-rw-r--r-- | file_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/file_test.go b/file_test.go index 8e65c5d..83a9b78 100644 --- a/file_test.go +++ b/file_test.go @@ -71,6 +71,14 @@ func TestWriteTo(t *testing.T) { _, err := f.WriteTo(bufio.NewWriter(&buf)) assert.EqualError(t, err, "zip: FileHeader.Name too long") } + // Test write with unsupported workbook file format + { + f, buf := File{Pkg: sync.Map{}}, bytes.Buffer{} + f.Pkg.Store("/d", []byte("s")) + f.Path = "Book1.xls" + _, err := f.WriteTo(bufio.NewWriter(&buf)) + assert.EqualError(t, err, ErrWorkbookFileFormat.Error()) + } } func TestClose(t *testing.T) { |