From 00fd38644d905c9ce17f32ab6873ba8eeac57cd1 Mon Sep 17 00:00:00 2001 From: tadf Date: Tue, 15 May 2012 22:03:37 +0000 Subject: * 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 --- test/date/test_date_strftime.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/date/test_date_strftime.rb') 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) -- cgit v1.2.3