summaryrefslogtreecommitdiff
path: root/stream_test.go
diff options
context:
space:
mode:
authorThomas Charbonnel <thomascharbonnel@users.noreply.github.com>2022-08-04 16:50:33 +0800
committerGitHub <noreply@github.com>2022-08-04 16:50:33 +0800
commit4a029f7e3602ac48b6fbf410b86adac2af64983a (patch)
tree2b67583f2de49b8a17c6a418d69c97aff3425424 /stream_test.go
parent504d469d3da34602a9a88bd76669ce44fdbc67cf (diff)
This closes #1299 skip write nil values in SetRow (#1301)
Co-authored-by: Thomas Charbonnel <github@charbonnel.email>
Diffstat (limited to 'stream_test.go')
-rw-r--r--stream_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/stream_test.go b/stream_test.go
index 6843e20..8f6a5b4 100644
--- a/stream_test.go
+++ b/stream_test.go
@@ -209,6 +209,17 @@ func TestSetRow(t *testing.T) {
assert.EqualError(t, streamWriter.SetRow("A", []interface{}{}), newCellNameToCoordinatesError("A", newInvalidCellNameError("A")).Error())
}
+func TestSetRowNilValues(t *testing.T) {
+ file := NewFile()
+ streamWriter, err := file.NewStreamWriter("Sheet1")
+ assert.NoError(t, err)
+ streamWriter.SetRow("A1", []interface{}{nil, nil, Cell{Value: "foo"}})
+ streamWriter.Flush()
+ ws, err := file.workSheetReader("Sheet1")
+ assert.NoError(t, err)
+ assert.NotEqual(t, ws.SheetData.Row[0].C[0].XMLName.Local, "c")
+}
+
func TestSetCellValFunc(t *testing.T) {
f := NewFile()
sw, err := f.NewStreamWriter("Sheet1")