summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_pivot_table_cache_definition.rb
diff options
context:
space:
mode:
authorRob Donnelly <[email protected]>2021-02-03 13:08:02 -0800
committerRob Donnelly <[email protected]>2021-02-03 13:08:02 -0800
commit82331ab312935111217359b0a24cc20acaf9457e (patch)
treea156b42778ed8470cf182ec9f8caba1dffdb2626 /test/workbook/worksheet/tc_pivot_table_cache_definition.rb
parentcda1ce451db1c0754f1e102e1d809467c79a6d8f (diff)
downloadcaxlsx-82331ab312935111217359b0a24cc20acaf9457e.tar.gz
caxlsx-82331ab312935111217359b0a24cc20acaf9457e.zip
Add test for special characters in pivot table cache definition
Diffstat (limited to 'test/workbook/worksheet/tc_pivot_table_cache_definition.rb')
-rw-r--r--test/workbook/worksheet/tc_pivot_table_cache_definition.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_pivot_table_cache_definition.rb b/test/workbook/worksheet/tc_pivot_table_cache_definition.rb
index 282078b0..37d7e485 100644
--- a/test/workbook/worksheet/tc_pivot_table_cache_definition.rb
+++ b/test/workbook/worksheet/tc_pivot_table_cache_definition.rb
@@ -51,4 +51,12 @@ class TestPivotTableCacheDefinition < Test::Unit::TestCase
assert(errors.empty?, "error free validation")
end
+ def test_to_xml_string_for_special_characters
+ cell = @ws.rows.first.cells.first
+ cell.value = "&><'\""
+
+ doc = Nokogiri::XML(@cache_definition.to_xml_string)
+ errors = doc.errors
+ assert(errors.empty?, "invalid xml: #{errors.map(&:to_s).join(', ')}")
+ end
end