summaryrefslogtreecommitdiff
path: root/pivotTable_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2022-11-13 00:40:04 +0800
committerxuri <xuri.me@gmail.com>2022-11-13 00:40:04 +0800
commitac564afa56a691e378ab9bb04cb14bb283886a16 (patch)
treedef0303fd88e78897a3c739c31c89cff8f492d43 /pivotTable_test.go
parentbd5dd17673f767b9f4643423c77eec486f2ad53f (diff)
Remove internal error log print, throw XML deserialize error
Diffstat (limited to 'pivotTable_test.go')
-rw-r--r--pivotTable_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pivotTable_test.go b/pivotTable_test.go
index 5d2e537..fc9e090 100644
--- a/pivotTable_test.go
+++ b/pivotTable_test.go
@@ -259,6 +259,15 @@ func TestAddPivotTable(t *testing.T) {
// Test get pivot fields index with empty data range
_, err = f.getPivotFieldsIndex([]PivotTableField{}, &PivotTableOptions{})
assert.EqualError(t, err, `parameter 'DataRange' parsing error: parameter is required`)
+ // Test add pivot table with unsupported charset content types.
+ f = NewFile()
+ f.ContentTypes = nil
+ f.Pkg.Store(defaultXMLPathContentTypes, MacintoshCyrillicCharset)
+ assert.EqualError(t, f.AddPivotTable(&PivotTableOptions{
+ DataRange: "Sheet1!$A$1:$E$31",
+ PivotTableRange: "Sheet1!$G$2:$M$34",
+ Rows: []PivotTableField{{Data: "Year"}},
+ }), "XML syntax error on line 1: invalid UTF-8")
}
func TestAddPivotRowFields(t *testing.T) {