1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/net-ftp] Add test cases

https://github.com/ruby/net-ftp/commit/865232bb2a
This commit is contained in:
Shugo Maeda 2021-04-21 10:10:51 +09:00 committed by Hiroshi SHIBATA
parent 4ae27d8075
commit 2670509ebb

View file

@ -2510,6 +2510,12 @@ EOF
end end
def test_time_parser def test_time_parser
s = "20371231000000"
assert_equal(Time.utc(2037, 12, 31, 0, 0, 0),
Net::FTP::TIME_PARSER[s])
s = "20371231000000.123456"
assert_equal(Time.utc(2037, 12, 31, 0, 0, 0, 123456),
Net::FTP::TIME_PARSER[s])
s = "20371231000000." + "9" * 999999999 s = "20371231000000." + "9" * 999999999
assert_equal(Time.utc(2037, 12, 31, 0, 0, 0, assert_equal(Time.utc(2037, 12, 31, 0, 0, 0,
99999999999999999r / 100000000000), 99999999999999999r / 100000000000),