mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 18:43:59 +02:00
* strftime.c (rb_strftime): A width specifier for %t and %n should
work. [ruby-dev:37160] * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aa498028b2
commit
bf1d53e2e0
3 changed files with 32 additions and 10 deletions
|
@ -449,5 +449,17 @@ class TestTime < Test::Unit::TestCase
|
|||
t = Time.mktime(1970, 1, 18)
|
||||
assert_equal("0", t.strftime("%w"))
|
||||
assert_equal("7", t.strftime("%u"))
|
||||
|
||||
# [ruby-dev:37160]
|
||||
assert_equal("\t", T2000.strftime("%t"))
|
||||
assert_equal("\t", T2000.strftime("%0t"))
|
||||
assert_equal("\t", T2000.strftime("%1t"))
|
||||
assert_equal(" \t", T2000.strftime("%3t"))
|
||||
assert_equal("00\t", T2000.strftime("%03t"))
|
||||
assert_equal("\n", T2000.strftime("%n"))
|
||||
assert_equal("\n", T2000.strftime("%0n"))
|
||||
assert_equal("\n", T2000.strftime("%1n"))
|
||||
assert_equal(" \n", T2000.strftime("%3n"))
|
||||
assert_equal("00\n", T2000.strftime("%03n"))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue