diff options
Diffstat (limited to 'styles_test.go')
-rw-r--r-- | styles_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/styles_test.go b/styles_test.go index 19092af..69266ea 100644 --- a/styles_test.go +++ b/styles_test.go @@ -330,3 +330,18 @@ func TestThemeColor(t *testing.T) { assert.Equal(t, clr[0], clr[1]) } } + +func TestGetNumFmtID(t *testing.T) { + f := NewFile() + + fs1, err := parseFormatStyleSet(`{"protection":{"hidden":false,"locked":false},"number_format":10}`) + assert.NoError(t, err) + id1 := getNumFmtID(&xlsxStyleSheet{}, fs1) + + fs2, err := parseFormatStyleSet(`{"protection":{"hidden":false,"locked":false},"number_format":0}`) + assert.NoError(t, err) + id2 := getNumFmtID(&xlsxStyleSheet{}, fs2) + + assert.NotEqual(t, id1, id2) + assert.NoError(t, f.SaveAs(filepath.Join("test", "TestStyleNumFmt.xlsx"))) +}
\ No newline at end of file |