aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 14:57:35 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 14:57:35 +0000
commita0cc5b19b7fa4207496a74d2ef8f39480eac44b5 (patch)
tree9e51d949df4dc0aca0f94cd465478998cc598ed7 /test
parent60bc53a1615222d2ad0b111ca84975093cf6efc1 (diff)
downloadruby-a0cc5b19b7fa4207496a74d2ef8f39480eac44b5.tar.gz
* strftime.c (rb_strftime): supported %F and %<precision>N.
reverted config.h to ruby.h for Windows. * test/ruby/test_time.rb (TestTime::test_strftime): added tests for %F and %N. * time.c: documented %F and %N. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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