[Ironruby-core] Array Specs
Orion.Edwards at gallagher.co
Thu Jan 5 16:45:08 EST 2012
I've pushed some more changes to that branch:
I also had a look at a couple of others but didn't fix them:
This requires changing implementation of RubyArray#GetHashCode which I
wasn't confident enough to do
In ruby, a recursive array equals itself, and therefore the hashcodes
should match. IronRuby's implementation of hash doesn't support this.
Furthermore, the following code should pass, which seemed quite a bit
a = 
a << a
[1,a] == a # both MRI and IR report true for this
[1,a].hash == a.hash # Because objects are equal, hash should be too. MRI
supports this, IR does not.
This was causing the tests to hang/crash because IR wasn't sanity checking
lengths. Rubyspec has a test which tries to create a stupdendously large
product array, and so IR would run out of memory.
I added range checking so the tests no longer hang/crash, but there is
some additional behaviour (you can pass a block to Array#product in 1.9)
that I haven't implemented.
Here's the output for mspec of the array folder:
Finished in 18.282046 seconds
112 files, 2393 examples, 4819 expectations, 191 failures, 72 errors
MRI 1.9.2 p290
Finished in 2.189125 seconds
112 files, 2393 examples, 4922 expectations, 162 failures, 0 errors
From: Tomas Matousek <Tomas.Matousek at microsoft.com>
To: "ironruby-core at rubyforge.org" <ironruby-core at rubyforge.org>
Date: 05/01/2012 05:59 p.m.
Subject: Re: [Ironruby-core] Array Specs
Sent by: ironruby-core-bounces at rubyforge.org
Cool! I?ll take a look asap.
From: ironruby-core-bounces at rubyforge.org [
mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards
Sent: Wednesday, January 04, 2012 1:54 PM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Array Specs
I've been working on bringing IronRuby up to speed with rubyspec, and
picked the core\array folder as a start:
My pull request is here:
I'd like to fix them all, but I'm not sure if I'll have the time to do so
Here is a summary of the rubyspec\core\array folder as of right now:
ok means the spec was already passing
fixed means the spec was failing, and I have fixed it
FAILS means the specs fail, and I have not fixed them yet
FAILS in MRI also pack_spec.rb
!! HANGS product_spec.rb
FAILS hard to fix sort_by_spec.rb
FAILS hard to fix sort_spec.rb
Ironruby-core mailing list
Ironruby-core at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironruby-core