summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-02-08 00:39:56 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2023-02-08 00:39:56 -0500
commitae103e148eb3c15606b816505492d870ef062ad3 (patch)
treeb7916225d76ac8d1db28feff7aa46a4ee672b3dc /test
parentf5fb17e5a64b215644bc104f099dad8c2f10c37d (diff)
New upstream version 2.10.0.upstream/2.10.0
Diffstat (limited to 'test')
-rw-r--r--test/files/apostrophe.odsbin0 -> 8583 bytes
-rw-r--r--test/files/boolean-from-google-sheets.odsbin0 -> 8099 bytes
-rw-r--r--test/files/boolean-from-google-sheets.xlsxbin0 -> 4665 bytes
-rw-r--r--test/files/currency-euro.xlsxbin0 -> 499104 bytes
-rw-r--r--test/files/currency-uk.xlsxbin0 -> 499099 bytes
-rw-r--r--test/files/currency-us.xlsxbin0 -> 499043 bytes
-rw-r--r--test/files/frozen_string.odsbin0 -> 1219 bytes
-rw-r--r--test/files/implicit_coordinates.xlsxbin0 -> 4405 bytes
-rw-r--r--test/files/wrong_coordinates.xlsxbin0 -> 11327 bytes
-rw-r--r--test/roo/test_excelx.rb9
-rw-r--r--test/test_roo.rb30
11 files changed, 39 insertions, 0 deletions
diff --git a/test/files/apostrophe.ods b/test/files/apostrophe.ods
new file mode 100644
index 0000000..9a4e4a6
--- /dev/null
+++ b/test/files/apostrophe.ods
Binary files differ
diff --git a/test/files/boolean-from-google-sheets.ods b/test/files/boolean-from-google-sheets.ods
new file mode 100644
index 0000000..246a5a8
--- /dev/null
+++ b/test/files/boolean-from-google-sheets.ods
Binary files differ
diff --git a/test/files/boolean-from-google-sheets.xlsx b/test/files/boolean-from-google-sheets.xlsx
new file mode 100644
index 0000000..7801156
--- /dev/null
+++ b/test/files/boolean-from-google-sheets.xlsx
Binary files differ
diff --git a/test/files/currency-euro.xlsx b/test/files/currency-euro.xlsx
new file mode 100644
index 0000000..c160836
--- /dev/null
+++ b/test/files/currency-euro.xlsx
Binary files differ
diff --git a/test/files/currency-uk.xlsx b/test/files/currency-uk.xlsx
new file mode 100644
index 0000000..8b709dd
--- /dev/null
+++ b/test/files/currency-uk.xlsx
Binary files differ
diff --git a/test/files/currency-us.xlsx b/test/files/currency-us.xlsx
new file mode 100644
index 0000000..a11dfa5
--- /dev/null
+++ b/test/files/currency-us.xlsx
Binary files differ
diff --git a/test/files/frozen_string.ods b/test/files/frozen_string.ods
new file mode 100644
index 0000000..55e0e1b
--- /dev/null
+++ b/test/files/frozen_string.ods
Binary files differ
diff --git a/test/files/implicit_coordinates.xlsx b/test/files/implicit_coordinates.xlsx
new file mode 100644
index 0000000..039d018
--- /dev/null
+++ b/test/files/implicit_coordinates.xlsx
Binary files differ
diff --git a/test/files/wrong_coordinates.xlsx b/test/files/wrong_coordinates.xlsx
new file mode 100644
index 0000000..0c6614e
--- /dev/null
+++ b/test/files/wrong_coordinates.xlsx
Binary files differ
diff --git a/test/roo/test_excelx.rb b/test/roo/test_excelx.rb
index 61161f0..c90cd8c 100644
--- a/test/roo/test_excelx.rb
+++ b/test/roo/test_excelx.rb
@@ -341,6 +341,15 @@ class TestRworkbookExcelx < Minitest::Test
assert_equal "Example richtext", xlsx.cell("b", 1)
end
+ def test_implicit_coordinates
+ xlsx = roo_class.new(File.join(TESTDIR, 'implicit_coordinates.xlsx'))
+
+ assert_equal 'Test', xlsx.cell('a', 1)
+ assert_equal 'A2', xlsx.cell('a', 2)
+ assert_equal 'B2', xlsx.cell(2, 2)
+ assert_equal 'C2', xlsx.cell('c', 2)
+ end
+
def roo_class
Roo::Excelx
end
diff --git a/test/test_roo.rb b/test/test_roo.rb
index dae4a41..bd1188d 100644
--- a/test/test_roo.rb
+++ b/test/test_roo.rb
@@ -274,6 +274,24 @@ class TestRoo < Minitest::Test
end
end
+ def test_cell_boolean_from_google_sheets
+ with_each_spreadsheet(:name=>'boolean-from-google-sheets', :format=>[:openoffice, :excelx]) do |oo|
+ if oo.class == Roo::Excelx
+ assert_equal true, oo.cell(1, 1), "failure in #{oo.class}"
+ assert_equal false, oo.cell(2, 1), "failure in #{oo.class}"
+
+ cell = oo.sheet_for(oo.default_sheet).cells[[1, 1,]]
+ assert_equal 'TRUE', cell.formatted_value
+
+ cell = oo.sheet_for(oo.default_sheet).cells[[2, 1,]]
+ assert_equal 'FALSE', cell.formatted_value
+ else
+ assert_equal "true", oo.cell(1,1), "failure in #{oo.class}"
+ assert_equal "false", oo.cell(2,1), "failure in #{oo.class}"
+ end
+ end
+ end
+
def test_cell_multiline
with_each_spreadsheet(:name=>'paragraph', :format=>[:openoffice, :excelx]) do |oo|
assert_equal "This is a test\nof a multiline\nCell", oo.cell(1,1)
@@ -282,6 +300,18 @@ class TestRoo < Minitest::Test
end
end
+ def test_apostrophe_replacement
+ with_each_spreadsheet(:name=>'apostrophe', :format=>[:openoffice]) do |oo|
+ assert_equal "'", oo.cell(1,1)
+ end
+ end
+
+ def test_frozen_string_usage
+ with_each_spreadsheet(:name=>'frozen_string', :format=>[:openoffice]) do |oo|
+ assert_equal "", oo.cell(1,1)
+ end
+ end
+
def test_row_whitespace
# auf dieses Dokument habe ich keinen Zugriff TODO:
# TODO: No access to document whitespace?