diff options
| author | Rob Donnelly <[email protected]> | 2021-02-03 13:08:02 -0800 |
|---|---|---|
| committer | Rob Donnelly <[email protected]> | 2021-02-03 13:08:02 -0800 |
| commit | 82331ab312935111217359b0a24cc20acaf9457e (patch) | |
| tree | a156b42778ed8470cf182ec9f8caba1dffdb2626 /test/workbook/worksheet/tc_pivot_table_cache_definition.rb | |
| parent | cda1ce451db1c0754f1e102e1d809467c79a6d8f (diff) | |
| download | caxlsx-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.rb | 8 |
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 |
