JRuby fails test/externals/bfts/test_time.rb on Japanese environment
--------------------------------------------------------------------

                 Key: JRUBY-1749
                 URL: http://jira.codehaus.org/browse/JRUBY-1749
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
         Environment: Mac OS X 10.4.11, Java 1.5.0_07, JRuby 1.1-SNAPSHOT, 
Japanese environment
            Reporter: Takanori Ishikawa
            Priority: Minor
         Attachments: fix_localized_asctime.patch

JRuby 1.1-SNAPSHOT fails test/externals/bfts/test_time.rb on Japanese 
environment (Mac OS X): 

{noformat}
-----------------------------------------------------------
  % ant clean test
    [junit] junit.framework.AssertionFailedError: Faults encountered running 
test/externals/bfts/test_time, complete output follows:
    [junit] Failure:
    [junit] test_asctime(TestTime) [./test/externals/bfts/test_time.rb:142]:
    [junit] <"Thu Jan  1 00:00:00 1970"> expected but was
    [junit] <"? 1  1 00:00:00 1970">.
    [junit] Failure:
    [junit] test_ctime(TestTime) [./test/externals/bfts/test_time.rb:289]:
    [junit] <"Thu Jan  1 00:00:00 1970"> expected but was
    [junit] <"? 1  1 00:00:00 1970">.
    [junit] Failure:
    [junit] test_inspect(TestTime) [./test/externals/bfts/test_time.rb:392]:
    [junit] <"Sat Feb 03 04:05:06 UTC 2001"> expected but was
    [junit] <"? 2 03 04:05:06 UTC 2001">.
    [junit] Failure:
    [junit] test_to_s(TestTime) [./test/externals/bfts/test_time.rb:611]:
    [junit] <"Sat Feb 03 04:05:06 UTC 2001"> expected but was
    [junit] <"? 2 03 04:05:06 UTC 2001">.
-----------------------------------------------------------
{noformat}

MRI passes this fine.

{noformat}
-----------------------------------------------------------
  % cd test/externals/bfts/      
  % ruby test_time.rb 
  Loaded suite test_time
  Started
  ........................................................
  Finished in 0.377285 seconds.
  
  56 tests, 1604 assertions, 0 failures, 0 errors
-----------------------------------------------------------
{noformat}

Also, the following example works incorrectly in JRuby: 

{noformat}
-----------------------------------------------------------
% irb
irb(main):001:0> Time.at(0).asctime
=> "Thu Jan  1 09:00:00 1970"

% jirb
irb(main):001:0> Time.at(0).asctime
=> "? 1  1 09:00:00 1970"
-----------------------------------------------------------
{noformat}

The problem lies in RubyTime class. Its formatter should be initialized with 
English locale to adapt with MRI behavior.

The proposed patch (fix_localized_asctime.patch) fixes and eliminates the unit 
test failure.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to