diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-15 22:03:37 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-15 22:03:37 +0000 |
commit | 00fd38644d905c9ce17f32ab6873ba8eeac57cd1 (patch) | |
tree | e660d8129425c64a8892e37e85663940086fbec2 /test/date | |
parent | b4bdb2f2ebcdd8d77826706470fdeed642b3dee5 (diff) |
* ext/date/date_strftime.c: should also be aware of flags on
complex specifier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/date')
-rw-r--r-- | test/date/test_date_strftime.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/date/test_date_strftime.rb b/test/date/test_date_strftime.rb index 76dbed2fc2..e6bfed8e21 100644 --- a/test/date/test_date_strftime.rb +++ b/test/date/test_date_strftime.rb @@ -336,6 +336,21 @@ class TestDateStrftime < Test::Unit::TestCase assert_equal('+09:08:07', d.strftime('%:::z')) end + def test_strftime__gnuext_complex + d = DateTime.parse('2001-02-03T04:05:06+09:00') + assert_equal('Sat Feb 3 04:05:06 2001', d.strftime('%-100c')) + assert_equal('Sat Feb 3 04:05:06 2001'.rjust(100), d.strftime('%100c')) + assert_equal('Sat Feb 3 04:05:06 2001'.rjust(100), d.strftime('%_100c')) + assert_equal('Sat Feb 3 04:05:06 2001'.rjust(100, '0'), d.strftime('%0100c')) + assert_equal('SAT FEB 3 04:05:06 2001', d.strftime('%^c')) + + assert_equal('Sat Feb 3 04:05:06 +09:00 2001', d.strftime('%-100+')) + assert_equal('Sat Feb 3 04:05:06 +09:00 2001'.rjust(100), d.strftime('%100+')) + assert_equal('Sat Feb 3 04:05:06 +09:00 2001'.rjust(100), d.strftime('%_100+')) + assert_equal('Sat Feb 3 04:05:06 +09:00 2001'.rjust(100, '0'), d.strftime('%0100+')) + assert_equal('SAT FEB 3 04:05:06 +09:00 2001', d.strftime('%^+')) + end + def test__different_format d = Date.new(2001,2,3) |