JRuby fails built-in unit tests from time.rb lib 
-------------------------------------------------

                 Key: JRUBY-1655
                 URL: http://jira.codehaus.org/browse/JRUBY-1655
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.x
         Environment: JRuby 1.1b1 (latest from trunk)
            Reporter: Vladimir Sizikov
            Assignee: Thomas E Enebo
         Attachments: time_usec.diff

JRuby fails built-in unit tests from time.rb lib:

 #>jruby lib/ruby/1.8/time.rb
Loaded suite lib/ruby/1.8/time
Started
.F............
Finished in 0.34800000000000003 seconds.

  1) Failure:
test_encode_xmlschema(TimeExtentionTest)
    [/opt/work/jruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block'
     /opt/work/jruby/lib/ruby/1.8/test/unit/assertions.rb:46:in 
`_wrap_assertion'
     /opt/work/jruby/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block'
     /opt/work/jruby/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_equal'
     /opt/work/jruby/lib/ruby/1.8/test/unit/assertions.rb:83:in 
`test_encode_xmlschema'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testcase.rb:72:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run_suite'
     /opt/work/jruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in 
`start_mediator'
     /opt/work/jruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in 
`start'
     /opt/work/jruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in 
`run'
     /opt/work/jruby/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit.rb:278:in `run'
     /opt/work/jruby/lib/ruby/1.8/test/unit.rb:276]:
<"1960-12-31T23:00:00.123456Z"> expected but was
<"1960-12-31T23:00:00.-87654Z">.

MRI passes the tests just fine.

Also, the following very simple example works incorrectly in JRuby:
=============
require 'time'
puts t = Time.utc(1960, 12, 31, 23, 30, 15, 123456)
============

Should return (in MRI):
1960-12-31T23:30:00.123456Z,
but returns
1960-12-31T23:30:00.-87654Z

The problem lies in RubyTime's class incorrect behavior for usec method.

The proposed patch fixes the problem 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