From: Shugo Maeda Date: 2008-08-28T22:35:08+09:00 Subject: [ruby-dev:36031] Re: [Bug #500] TZ=HSTでFailure: test_strftime(TestTime) 前田です。 2008/08/27 1:23 Kazuhiro NISHIYAMA : > http://zunda.freeshell.org/d/20080825.html#p04 > によるとローカルのタイムゾーンによっては失敗することがあるようです。 > > % env TZ=HST ruby-trunk -v test/ruby/test_time.rb -n /strftime/ > ruby 1.9.0 (2008-08-25 revision 18832) [i686-linux] > Loaded suite test/ruby/test_time > Started > test/ruby/test_time.rb:377: warning: strftime called with empty format string > F > Finished in 0.01258855 seconds. 遠藤さんがr15399で追加されたテストのようですが、もともとどういう意図のテスト でしょうか? とりあえず、以下のように変えれば環境変数TZの値によらずテストが通るようには なりますが…。 Index: test/ruby/test_time.rb =================================================================== --- test/ruby/test_time.rb (revision 18897) +++ test/ruby/test_time.rb (working copy) @@ -378,7 +378,8 @@ assert_equal("foo\0bar\x0000\x0000\x0000", T2000.strftime("foo\0bar\0%H\0%M \0%S")) assert_equal("foo" * 1000, T2000.strftime("foo" * 1000)) - assert_equal("Sat", Time.at(946684800).strftime("%a")) + t = Time.mktime(2000, 1, 1) + assert_equal("Sat", t.strftime("%a")) t = Time.at(946684800, 123456.789) assert_equal("123", t.strftime("%3N")) -- Shugo Maeda