diff options
author | xuri <xuri.me@gmail.com> | 2021-09-18 23:20:24 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-09-19 11:06:54 +0800 |
commit | 790c363cceaaa09e91ad579e2d25cb13c1582bba (patch) | |
tree | b5747f30edeac96a7fdadec574f1a5b1d332ca18 /stream_test.go | |
parent | 2add938798cdd1456616869298319528b0c76913 (diff) |
This closes #833, closes #845, and closes #1022, breaking changes
- Close spreadsheet and row's iterator required
- New options `WorksheetUnzipMemLimit` have been added
- Improve streaming reading performance, memory usage decrease about 93.7%
Diffstat (limited to 'stream_test.go')
-rw-r--r-- | stream_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/stream_test.go b/stream_test.go index fda44fb..6cfed07 100644 --- a/stream_test.go +++ b/stream_test.go @@ -115,6 +115,21 @@ func TestStreamWriter(t *testing.T) { cellValue, err := file.GetCellValue("Sheet1", "A1") assert.NoError(t, err) assert.Equal(t, "Data", cellValue) + + // Test stream reader for a worksheet with huge amounts of data. + file, err = OpenFile(filepath.Join("test", "TestStreamWriter.xlsx")) + assert.NoError(t, err) + rows, err := file.Rows("Sheet1") + assert.NoError(t, err) + cells := 0 + for rows.Next() { + row, err := rows.Columns() + assert.NoError(t, err) + cells += len(row) + } + assert.NoError(t, rows.Close()) + assert.Equal(t, 2559558, cells) + assert.NoError(t, file.Close()) } func TestStreamSetColWidth(t *testing.T) { |