summaryrefslogtreecommitdiff
path: root/stream_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-04-28 02:04:36 +0000
committerxuri <xuri.me@gmail.com>2021-04-28 02:04:36 +0000
commitaf5e87dbcf5a89201072f5ca07d532258ece278f (patch)
tree51edb1a6082e4c291e467cc3fb35845f9f993763 /stream_test.go
parenta13ef5545ec79108477910346ae4cab82ab8bbda (diff)
#826, support merge cell in streaming mode
Diffstat (limited to 'stream_test.go')
-rw-r--r--stream_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/stream_test.go b/stream_test.go
index 322eea9..26732d8 100644
--- a/stream_test.go
+++ b/stream_test.go
@@ -134,6 +134,18 @@ func TestStreamTable(t *testing.T) {
assert.EqualError(t, streamWriter.AddTable("A1", "B", `{}`), `cannot convert cell "B" to coordinates: invalid cell name "B"`)
}
+func TestStreamMergeCells(t *testing.T) {
+ file := NewFile()
+ streamWriter, err := file.NewStreamWriter("Sheet1")
+ assert.NoError(t, err)
+ assert.NoError(t, streamWriter.MergeCell("A1", "D1"))
+ // Test merge cells with illegal cell coordinates.
+ assert.EqualError(t, streamWriter.MergeCell("A", "D1"), `cannot convert cell "A" to coordinates: invalid cell name "A"`)
+ assert.NoError(t, streamWriter.Flush())
+ // Save spreadsheet by the given path.
+ assert.NoError(t, file.SaveAs(filepath.Join("test", "TestStreamMergeCells.xlsx")))
+}
+
func TestNewStreamWriter(t *testing.T) {
// Test error exceptions
file := NewFile()