aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_time.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_time.rb')
-rw-r--r--test/ruby/test_time.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index a84cbd9ec6..6188a3064b 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -383,5 +383,17 @@ class TestTime < Test::Unit::TestCase
t = Time.at(946684800, 123456.789)
assert_equal("123", t.strftime("%L"))
assert_equal("123456789", t.strftime("%N"))
+ assert_equal("123", t.strftime("%3N"))
+ assert_equal("123456", t.strftime("%6N"))
+ assert_equal("123456789", t.strftime("%9N"))
+ assert_equal("123456789", t.strftime("%10N"))
+ assert_equal("123456789", t.strftime("%1" + "0" * 100 + "N"))
+ assert_equal("", t.strftime("%0N"))
+ assert_equal("%3S", t.strftime("%3S"))
+ fmt = "%1" + "0" * 100 + "S"
+ assert_equal(fmt, t.strftime(fmt))
+
+ t = Time.mktime(2001, 10, 1)
+ assert_equal("2001-10-01", t.strftime("%F"))
end
end