diff options
Diffstat (limited to 'styles_test.go')
-rw-r--r-- | styles_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/styles_test.go b/styles_test.go index 9b8ba39..b68365b 100644 --- a/styles_test.go +++ b/styles_test.go @@ -3,6 +3,7 @@ package excelize import ( "fmt" "path/filepath" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -200,6 +201,10 @@ func TestNewStyle(t *testing.T) { assert.NoError(t, err) _, err = f.NewStyle(Style{}) assert.EqualError(t, err, "invalid parameter type") + _, err = f.NewStyle(&Style{Font: &Font{Family: strings.Repeat("s", MaxFontFamilyLength+1)}}) + assert.EqualError(t, err, "the length of the font family name must be smaller than or equal to 31") + _, err = f.NewStyle(&Style{Font: &Font{Size: MaxFontSize + 1}}) + assert.EqualError(t, err, "font size must be between 1 and 409 points") } func TestGetDefaultFont(t *testing.T) { |