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 --- col_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'col_test.go') diff --git a/col_test.go b/col_test.go index b7d3823..1076f31 100644 --- a/col_test.go +++ b/col_test.go @@ -296,6 +296,10 @@ func TestSetColStyle(t *testing.T) { // Test set column style with illegal cell coordinates. assert.EqualError(t, f.SetColStyle("Sheet1", "*", styleID), newInvalidColumnNameError("*").Error()) assert.EqualError(t, f.SetColStyle("Sheet1", "A:*", styleID), newInvalidColumnNameError("*").Error()) + // Test set column style with invalid style ID. + assert.EqualError(t, f.SetColStyle("Sheet1", "B", -1), newInvalidStyleID(-1).Error()) + // Test set column style with not exists style ID. + assert.EqualError(t, f.SetColStyle("Sheet1", "B", 10), newInvalidStyleID(10).Error()) assert.NoError(t, f.SetColStyle("Sheet1", "B", styleID)) // Test set column style with already exists column with style. -- cgit v1.2.1