From 75ce2317286181e2c250c10206df892278d5b981 Mon Sep 17 00:00:00 2001 From: xuri Date: Thu, 1 Sep 2022 00:41:52 +0800 Subject: This closes #1323, an error will be returned when set the not exist style ID --- styles_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'styles_test.go') diff --git a/styles_test.go b/styles_test.go index 257f98d..47aee5b 100644 --- a/styles_test.go +++ b/styles_test.go @@ -342,6 +342,10 @@ func TestSetCellStyle(t *testing.T) { f := NewFile() // Test set cell style on not exists worksheet. assert.EqualError(t, f.SetCellStyle("SheetN", "A1", "A2", 1), "sheet SheetN does not exist") + // Test set cell style with invalid style ID. + assert.EqualError(t, f.SetCellStyle("Sheet1", "A1", "A2", -1), newInvalidStyleID(-1).Error()) + // Test set cell style with not exists style ID. + assert.EqualError(t, f.SetCellStyle("Sheet1", "A1", "A2", 10), newInvalidStyleID(10).Error()) } func TestGetStyleID(t *testing.T) { -- cgit v1.2.1