Review: Array#hash and irtests.bat

  •     Fixes Array#hash to work with recursive arrays
    
  •     Also updated ArraySpecs.recursive_array to produce a cycle of 
    

length 3. Previously, it was doing “a << a” multiple times, but this
does not increase the length of the cycle above 2. It just increase the
number of cycles. This change required an update to many files.

  •     Also added a new ArraySpecs.recursive_arrays function which 
    

should be used when dealing with two arrays (comparisons, merge, etc). I
have only used it in equal_value_spec and eql_spec for now…

  •     Also removed entries from critical_tags.txt since recursive 
    

hashing and comparison now works.

  •     Changed irtests.bat to not use "mspec -V" (unless you are 
    

using “irtests -par”) which was causing very verbose output

  •     Changed irtests.bat to only use two "mspec" tasks so that 
    

“irtest -par” will spawn fewer processes.

  •     Changed IronRuby.Tests.exe to show dots for each test instead 
    

of printing a new line which is very verbose

  •     Changed irtests.bat to continue running tests even if previous 
    

test task failed. It remembers the failed results and prints the summary
at the end.

  •     Added ruby19.bat so that "mspec -tr19" runs with Ruby 1.9. It 
    

requires you to set RUBY19_EXE to point to your copy of the 1.9 version
of ruby.exe

Thanks,
Shri

Re RubyArray.Equals(object)/GetHashCode: is it desirable to use value
equality here? These methods are only used from .NET libraries - e.g. if
the array is added into a dictionary as a key. Unless RubyArray is bound
to a runtime its .NET hash/equality implementation won’t be the same as
Ruby’s (ie. calling hash/eql? one each element). Wouldn’t be better if
RubyArray behaved like List in .NET collections?

Tomas

From: Shri B.
Sent: Friday, April 17, 2009 3:22 PM
To: IronRuby External Code R.
Cc: [email protected]
Subject: Review: Array#hash and irtests.bat

  •     Fixes Array#hash to work with recursive arrays
    
  •     Also updated ArraySpecs.recursive_array to produce a cycle of 
    

length 3. Previously, it was doing “a << a” multiple times, but this
does not increase the length of the cycle above 2. It just increase the
number of cycles. This change required an update to many files.

  •     Also added a new ArraySpecs.recursive_arrays function which 
    

should be used when dealing with two arrays (comparisons, merge, etc). I
have only used it in equal_value_spec and eql_spec for now…

  •     Also removed entries from critical_tags.txt since recursive 
    

hashing and comparison now works.

  •     Changed irtests.bat to not use "mspec -V" (unless you are 
    

using “irtests -par”) which was causing very verbose output

  •     Changed irtests.bat to only use two "mspec" tasks so that 
    

“irtest -par” will spawn fewer processes.

  •     Changed IronRuby.Tests.exe to show dots for each test instead 
    

of printing a new line which is very verbose

  •     Changed irtests.bat to continue running tests even if previous 
    

test task failed. It remembers the failed results and prints the summary
at the end.

  •     Added ruby19.bat so that "mspec -tr19" runs with Ruby 1.9. It 
    

requires you to set RUBY19_EXE to point to your copy of the 1.9 version
of ruby.exe

Thanks,
Shri

Mspec seems to be returning the wrong exitcode when used from
irtests.bat. The first mspec command which runs the core tests has
failures in Module#autoload but sets errorlevel to 0. And the second
command has no failures but sets errorlevel to 1. When I try out some
mspec commands manually, the errorlevel does seem to be set correctly.
So I am not sure why this is happenning. Once Jim pulls in my changes,
lets see if others get the incorrect behavior or not, and then we can
decide what to do. Jim, if you have any ideas of what might affect the
exitcode, let me know…

About RubyArray.Equals(object)/GetHashCode, I will be changing it in a
subsequent change to have it do reference equality.

From: Tomas M.
Sent: Monday, April 20, 2009 9:32 AM
To: Shri B.; IronRuby External Code R.
Cc: [email protected]
Subject: RE: Review: Array#hash and irtests.bat

Re RubyArray.Equals(object)/GetHashCode: is it desirable to use value
equality here? These methods are only used from .NET libraries - e.g. if
the array is added into a dictionary as a key. Unless RubyArray is bound
to a runtime its .NET hash/equality implementation won’t be the same as
Ruby’s (ie. calling hash/eql? one each element). Wouldn’t be better if
RubyArray behaved like List in .NET collections?

Tomas

From: Shri B.
Sent: Friday, April 17, 2009 3:22 PM
To: IronRuby External Code R.
Cc: [email protected]
Subject: Review: Array#hash and irtests.bat

  •     Fixes Array#hash to work with recursive arrays
    
  •     Also updated ArraySpecs.recursive_array to produce a cycle of 
    

length 3. Previously, it was doing “a << a” multiple times, but this
does not increase the length of the cycle above 2. It just increase the
number of cycles. This change required an update to many files.

  •     Also added a new ArraySpecs.recursive_arrays function which 
    

should be used when dealing with two arrays (comparisons, merge, etc). I
have only used it in equal_value_spec and eql_spec for now…

  •     Also removed entries from critical_tags.txt since recursive 
    

hashing and comparison now works.

  •     Changed irtests.bat to not use "mspec -V" (unless you are 
    

using “irtests -par”) which was causing very verbose output

  •     Changed irtests.bat to only use two "mspec" tasks so that 
    

“irtest -par” will spawn fewer processes.

  •     Changed IronRuby.Tests.exe to show dots for each test instead 
    

of printing a new line which is very verbose

  •     Changed irtests.bat to continue running tests even if previous 
    

test task failed. It remembers the failed results and prints the summary
at the end.

  •     Added ruby19.bat so that "mspec -tr19" runs with Ruby 1.9. It 
    

requires you to set RUBY19_EXE to point to your copy of the 1.9 version
of ruby.exe

Thanks,
Shri

Test looks good.

JD

From: Tomas M.
Sent: Monday, April 20, 2009 9:32 AM
To: Shri B.; IronRuby External Code R.
Cc: [email protected]
Subject: RE: Review: Array#hash and irtests.bat

Re RubyArray.Equals(object)/GetHashCode: is it desirable to use value
equality here? These methods are only used from .NET libraries - e.g. if
the array is added into a dictionary as a key. Unless RubyArray is bound
to a runtime its .NET hash/equality implementation won’t be the same as
Ruby’s (ie. calling hash/eql? one each element). Wouldn’t be better if
RubyArray behaved like List in .NET collections?

Tomas

From: Shri B.
Sent: Friday, April 17, 2009 3:22 PM
To: IronRuby External Code R.
Cc: [email protected]
Subject: Review: Array#hash and irtests.bat

  •     Fixes Array#hash to work with recursive arrays
    
  •     Also updated ArraySpecs.recursive_array to produce a cycle of 
    

length 3. Previously, it was doing “a << a” multiple times, but this
does not increase the length of the cycle above 2. It just increase the
number of cycles. This change required an update to many files.

  •     Also added a new ArraySpecs.recursive_arrays function which 
    

should be used when dealing with two arrays (comparisons, merge, etc). I
have only used it in equal_value_spec and eql_spec for now…

  •     Also removed entries from critical_tags.txt since recursive 
    

hashing and comparison now works.

  •     Changed irtests.bat to not use "mspec -V" (unless you are 
    

using “irtests -par”) which was causing very verbose output

  •     Changed irtests.bat to only use two "mspec" tasks so that 
    

“irtest -par” will spawn fewer processes.

  •     Changed IronRuby.Tests.exe to show dots for each test instead 
    

of printing a new line which is very verbose

  •     Changed irtests.bat to continue running tests even if previous 
    

test task failed. It remembers the failed results and prints the summary
at the end.

  •     Added ruby19.bat so that "mspec -tr19" runs with Ruby 1.9. It 
    

requires you to set RUBY19_EXE to point to your copy of the 1.9 version
of ruby.exe

Thanks,
Shri