summaryrefslogtreecommitdiff
path: root/rows_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-09-01 00:41:52 +0800
committerxuri <xuri.me@gmail.com>2022-09-01 00:41:52 +0800
commit75ce2317286181e2c250c10206df892278d5b981 (patch)
tree5e040d90cbb170a0cbdc0c6a57e0b86c7bc82845 /rows_test.go
parent18cd63a548afa1abcddc86a998fdefa3b4cc60c1 (diff)
This closes #1323, an error will be returned when set the not exist style ID
Diffstat (limited to 'rows_test.go')
-rw-r--r--rows_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/rows_test.go b/rows_test.go
index 829a27a..02e2d20 100644
--- a/rows_test.go
+++ b/rows_test.go
@@ -956,7 +956,10 @@ func TestSetRowStyle(t *testing.T) {
assert.NoError(t, f.SetCellStyle("Sheet1", "B2", "B2", style1))
assert.EqualError(t, f.SetRowStyle("Sheet1", 5, -1, style2), newInvalidRowNumberError(-1).Error())
assert.EqualError(t, f.SetRowStyle("Sheet1", 1, TotalRows+1, style2), ErrMaxRows.Error())
+ // Test set row style with invalid style ID.
assert.EqualError(t, f.SetRowStyle("Sheet1", 1, 1, -1), newInvalidStyleID(-1).Error())
+ // Test set row style with not exists style ID.
+ assert.EqualError(t, f.SetRowStyle("Sheet1", 1, 1, 10), newInvalidStyleID(10).Error())
assert.EqualError(t, f.SetRowStyle("SheetN", 1, 1, style2), "sheet SheetN does not exist")
assert.NoError(t, f.SetRowStyle("Sheet1", 5, 1, style2))
cellStyleID, err := f.GetCellStyle("Sheet1", "B2")