diff options
author | xuri <xuri.me@gmail.com> | 2021-07-25 00:43:07 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-07-25 00:43:07 +0800 |
commit | f9e9e5d2e07b087e2d4fb2487193aea8c240ab0e (patch) | |
tree | 34a83a6be65c8c6e3d2621a74fbc9e553f249567 /stream_test.go | |
parent | 5ce3fe8cb89f5f278b3857bab8e69c117c2a6027 (diff) |
This closes #882, support set rows height and hidden row by stream writer
Diffstat (limited to 'stream_test.go')
-rw-r--r-- | stream_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stream_test.go b/stream_test.go index f911ccc..fda44fb 100644 --- a/stream_test.go +++ b/stream_test.go @@ -55,9 +55,11 @@ func TestStreamWriter(t *testing.T) { // Test set cell with style. styleID, err := file.NewStyle(`{"font":{"color":"#777777"}}`) assert.NoError(t, err) - assert.NoError(t, streamWriter.SetRow("A4", []interface{}{Cell{StyleID: styleID}, Cell{Formula: "SUM(A10,B10)"}})) + assert.NoError(t, streamWriter.SetRow("A4", []interface{}{Cell{StyleID: styleID}, Cell{Formula: "SUM(A10,B10)"}}), RowOpts{Height: 45}) assert.NoError(t, streamWriter.SetRow("A5", []interface{}{&Cell{StyleID: styleID, Value: "cell"}, &Cell{Formula: "SUM(A10,B10)"}})) assert.NoError(t, streamWriter.SetRow("A6", []interface{}{time.Now()})) + assert.NoError(t, streamWriter.SetRow("A7", nil, RowOpts{Hidden: true})) + assert.EqualError(t, streamWriter.SetRow("A7", nil, RowOpts{Height: MaxRowHeight + 1}), ErrMaxRowHeight.Error()) for rowID := 10; rowID <= 51200; rowID++ { row := make([]interface{}, 50) |