summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-07 23:36:48 +0200
committerGeremia Taglialatela <[email protected]>2023-04-07 23:38:58 +0200
commit70d3dfc768ecbea6ea52e9481fbfd3068445bbc4 (patch)
treeb218d38d26a51bf6bb1216a81fc6c7acb491c265 /test
parent3460a7fbb808d43a2a027fb98ef40209498a86fd (diff)
downloadcaxlsx-70d3dfc768ecbea6ea52e9481fbfd3068445bbc4.tar.gz
caxlsx-70d3dfc768ecbea6ea52e9481fbfd3068445bbc4.zip
Fix Layout/ElseAlignment
Manually fixed
Diffstat (limited to 'test')
-rw-r--r--test/workbook/worksheet/tc_date_time_converter.rb58
1 files changed, 29 insertions, 29 deletions
diff --git a/test/workbook/worksheet/tc_date_time_converter.rb b/test/workbook/worksheet/tc_date_time_converter.rb
index 19278e95..225c1893 100644
--- a/test/workbook/worksheet/tc_date_time_converter.rb
+++ b/test/workbook/worksheet/tc_date_time_converter.rb
@@ -63,21 +63,21 @@ class TestDateTimeConverter < Test::Unit::TestCase
def test_time_to_serial_1900
Axlsx::Workbook.date1904 = false
tests = if @extended_time_range
- { # examples taken straight from the spec
- "1893-08-05T00:00:01Z" => -2337.999989,
- "1899-12-28T18:00:00Z" => -1.25,
- "1910-02-03T10:05:54Z" => 3687.4207639,
- "1900-01-01T12:00:00Z" => 2.5, # wrongly indicated as 1.5 in the spec!
- "9999-12-31T23:59:59Z" => 2958465.9999884
- }
- else
- { # examples taken inside the possible values
- "1970-01-01T00:00:00Z" => 25569.0, # Unix epoch
- "1970-01-01T12:00:00Z" => 25569.5,
- "2000-01-01T00:00:00Z" => 36526.0,
- "2038-01-19T03:14:07Z" => 50424.134803, # max signed timestamp in 32bit
- }
- end
+ { # examples taken straight from the spec
+ "1893-08-05T00:00:01Z" => -2337.999989,
+ "1899-12-28T18:00:00Z" => -1.25,
+ "1910-02-03T10:05:54Z" => 3687.4207639,
+ "1900-01-01T12:00:00Z" => 2.5, # wrongly indicated as 1.5 in the spec!
+ "9999-12-31T23:59:59Z" => 2958465.9999884
+ }
+ else
+ { # examples taken inside the possible values
+ "1970-01-01T00:00:00Z" => 25569.0, # Unix epoch
+ "1970-01-01T12:00:00Z" => 25569.5,
+ "2000-01-01T00:00:00Z" => 36526.0,
+ "2038-01-19T03:14:07Z" => 50424.134803, # max signed timestamp in 32bit
+ }
+ end
tests.each do |time_string, expected|
serial = Axlsx::DateTimeConverter::time_to_serial Time.parse(time_string)
assert_in_delta expected, serial, @margin_of_error
@@ -89,20 +89,20 @@ class TestDateTimeConverter < Test::Unit::TestCase
# ruby 1.8.7 cannot parse dates prior to epoch. see http://ruby-doc.org/core-1.8.7/Time.html
tests = if @extended_time_range
- { # examples taken straight from the spec
- "1893-08-05T00:00:01Z" => -3799.999989,
- "1910-02-03T10:05:54Z" => 2225.4207639,
- "1904-01-01T12:00:00Z" => 0.5000000,
- "9999-12-31T23:59:59Z" => 2957003.9999884
- }
- else
- { # examples taken inside the possible values
- "1970-01-01T00:00:00Z" => 24107.0, # Unix epoch
- "1970-01-01T12:00:00Z" => 24107.5,
- "2000-01-01T00:00:00Z" => 35064.0,
- "2038-01-19T03:14:07Z" => 48962.134803, # max signed timestamp in 32bit
- }
- end
+ { # examples taken straight from the spec
+ "1893-08-05T00:00:01Z" => -3799.999989,
+ "1910-02-03T10:05:54Z" => 2225.4207639,
+ "1904-01-01T12:00:00Z" => 0.5000000,
+ "9999-12-31T23:59:59Z" => 2957003.9999884
+ }
+ else
+ { # examples taken inside the possible values
+ "1970-01-01T00:00:00Z" => 24107.0, # Unix epoch
+ "1970-01-01T12:00:00Z" => 24107.5,
+ "2000-01-01T00:00:00Z" => 35064.0,
+ "2038-01-19T03:14:07Z" => 48962.134803, # max signed timestamp in 32bit
+ }
+ end
tests.each do |time_string, expected|
serial = Axlsx::DateTimeConverter::time_to_serial Time.parse(time_string)
assert_in_delta expected, serial, @margin_of_error