From: wanabe Date: 2008-08-12T18:55:54+09:00 Subject: [ruby-dev:35831] Re: [Ruby 1.9 - Bug #282] (Open) failure of test_asctime(TestTime) on mswin32 ワナベと申します。 2008/07/17 6:59 Usaku NAKAMURA : > test_asctime(TestTime) [(snip)/test/ruby/test_time.rb:291]: > <"Sat Jan 1 00:00:00 2000"> expected but was > <"Sat Jan 01 00:00:00 2000">. > > C90を読む限りは日付の部分は月名部分に続けて "%3d" なので、MSVCRTのバグです。 > しかしわざわざ対策すべきかどうかは微妙。 単純にこんな風に対応してしまうのは駄目なのでしょうか。 テストが毎回失敗するのは何だか気になります。 Index: time.c =================================================================== --- time.c (revision 18359) +++ time.c (working copy) @@ -1339,6 +1339,9 @@ } s = asctime(&tobj->tm); if (s[24] == '\n') s[24] = '\0'; +#ifdef _WIN32 + if (s[7] == ' ' && s[8] == '0') s[8] = ' '; +#endif return rb_str_new2(s); } -- ワナベ