summaryrefslogtreecommitdiff
path: root/test/net/ftp/test_ftp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/net/ftp/test_ftp.rb')
-rw-r--r--test/net/ftp/test_ftp.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb
index c84dbda10f..ba076dd779 100644
--- a/test/net/ftp/test_ftp.rb
+++ b/test/net/ftp/test_ftp.rb
@@ -1108,6 +1108,10 @@ EOF
commands.push(sock.gets)
sock.print("213 20150910161739.123456\r\n")
commands.push(sock.gets)
+ sock.print("213 20150910161739.123\r\n")
+ commands.push(sock.gets)
+ sock.print("213 20150910161739.123456789\r\n")
+ commands.push(sock.gets)
sock.print("213 2015091016173\r\n")
}
begin
@@ -1119,12 +1123,19 @@ EOF
ftp.mtime("foo.txt", true))
assert_equal(Time.utc(2015, 9, 10, 16, 17, 39, 123456),
ftp.mtime("bar.txt"))
+ assert_equal(Time.utc(2015, 9, 10, 16, 17, 39, 123000),
+ ftp.mtime("bar.txt"))
+ assert_equal(Time.utc(2015, 9, 10, 16, 17, 39,
+ Rational(123456789, 1000)),
+ ftp.mtime("bar.txt"))
assert_raise(Net::FTPProtoError) do
ftp.mtime("quux.txt")
end
assert_match("MDTM foo.txt\r\n", commands.shift)
assert_match("MDTM foo.txt\r\n", commands.shift)
assert_match("MDTM bar.txt\r\n", commands.shift)
+ assert_match("MDTM bar.txt\r\n", commands.shift)
+ assert_match("MDTM bar.txt\r\n", commands.shift)
assert_match("MDTM quux.txt\r\n", commands.shift)
assert_equal(nil, commands.shift)
ensure