From fb1aab7add52808c96c9cc10570fe73ce797b7f4 Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 8 Sep 2022 22:20:21 +0800 Subject: This closes #744, the `Save`, `Write` and `WriteTo` function accept saving options --- file_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'file_test.go') 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) { -- cgit v1.2.1