Skip to content

Commit

Permalink
fix: add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
p-eye committed Jul 24, 2024
1 parent 34de823 commit 28fdc3a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_value_converter_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,21 @@ def test_time
).create_converter
assert_equal nil, converter.call(nil)
assert_equal "00:03:22.000000", converter.call("00:03:22")
assert_equal "00:15:22.000000", converter.call("3:22 PM")
assert_equal "00:03:22.000000", converter.call("3:22 AM")
assert_equal "00:15:22.000000", converter.call("15:22")
assert_equal "00:03:22.000000", converter.call("03:22")
assert_equal "10:00:00.000000", converter.call("2024-07-24 10:00")

# Users must care of BQ datetime format by themselves with no timestamp_format
converter = ValueConverterFactory.new(SCHEMA_TYPE, 'TIME').create_converter
assert_equal nil, converter.call(nil)
assert_equal "00:03:22", converter.call("00:03:22")
assert_equal "00:15:22", converter.call("3:22 PM")
assert_equal "00:03:22", converter.call("3:22 AM")
assert_equal "00:15:22", converter.call("15:22")
assert_equal "00:03:22", converter.call("03:22")
assert_equal "10:00:00", converter.call("2024-07-24 10:00")
end

def test_record
Expand Down

0 comments on commit 28fdc3a

Please sign in to comment.