summaryrefslogtreecommitdiff
path: root/calcchain_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'calcchain_test.go')
-rw-r--r--calcchain_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/calcchain_test.go b/calcchain_test.go
index fae3a51..9eec804 100644
--- a/calcchain_test.go
+++ b/calcchain_test.go
@@ -33,7 +33,14 @@ func TestDeleteCalcChain(t *testing.T) {
formulaType, ref := STCellFormulaTypeShared, "C1:C5"
assert.NoError(t, f.SetCellFormula("Sheet1", "C1", "=A1+B1", FormulaOpts{Ref: &ref, Type: &formulaType}))
+
+ // Test delete calculation chain with unsupported charset calculation chain.
f.CalcChain = nil
f.Pkg.Store(defaultXMLPathCalcChain, MacintoshCyrillicCharset)
assert.EqualError(t, f.SetCellValue("Sheet1", "C1", true), "XML syntax error on line 1: invalid UTF-8")
+
+ // Test delete calculation chain with unsupported charset content types.
+ f.ContentTypes = nil
+ f.Pkg.Store(defaultXMLPathContentTypes, MacintoshCyrillicCharset)
+ assert.EqualError(t, f.deleteCalcChain(1, "A1"), "XML syntax error on line 1: invalid UTF-8")
}