# Review: Array#hash and irtests.bat

**URL:** <https://www.ruby-forum.com/t/review-array-hash-and-irtests-bat/165832>\
**Category:** IronRuby\
**Created:** [April 18, 2009, 12:22am UTC](https://www.ruby-forum.com/t/review-array-hash-and-irtests-bat/165832 "2009-04-18T00:22:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [April 18, 2009, 12:22am UTC](https://www.ruby-forum.com/t/review-array-hash-and-irtests-bat/165832/1 "2009-04-18T00:22:47Z")

</div>

> <https://github.com/shri-zz/ironruby/commit/7f3d766216c2fa533e208ac2a44b8de39cb03f7c>
>
> Also updated ArraySpecs.recursive\_array to produce a cycle of length 3. Previous…ly, 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.

- 

```
    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.

> <https://github.com/shri-zz/ironruby/commit/a011753ebab46652992a0d82a94437811f456381>
>
> Changed irtests.bat to only use two "mspec" tasks so that "irtest -par" will spa…wn 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

- 

```
    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

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [April 20, 2009, 6:37pm UTC](https://www.ruby-forum.com/t/review-array-hash-and-irtests-bat/165832/2 "2009-04-20T18:37:44Z")

</div>

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: removed\_email\_address@domain.invalid  
Subject: Review: Array#hash and irtests.bat

> <https://github.com/shri-zz/ironruby/commit/7f3d766216c2fa533e208ac2a44b8de39cb03f7c>
>
> Also updated ArraySpecs.recursive\_array to produce a cycle of length 3. Previous…ly, 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.

- 

```
    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.

> <https://github.com/shri-zz/ironruby/commit/a011753ebab46652992a0d82a94437811f456381>
>
> Changed irtests.bat to only use two "mspec" tasks so that "irtest -par" will spa…wn 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

- 

```
    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

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [April 21, 2009, 6:15am UTC](https://www.ruby-forum.com/t/review-array-hash-and-irtests-bat/165832/3 "2009-04-21T06:15:08Z")

</div>

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: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
Subject: Review: Array#hash and irtests.bat

> <https://github.com/shri-zz/ironruby/commit/7f3d766216c2fa533e208ac2a44b8de39cb03f7c>
>
> Also updated ArraySpecs.recursive\_array to produce a cycle of length 3. Previous…ly, 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.

- 

```
    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.

> <https://github.com/shri-zz/ironruby/commit/a011753ebab46652992a0d82a94437811f456381>
>
> Changed irtests.bat to only use two "mspec" tasks so that "irtest -par" will spa…wn 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

- 

```
    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

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [April 21, 2009, 8:10am UTC](https://www.ruby-forum.com/t/review-array-hash-and-irtests-bat/165832/4 "2009-04-21T08:10:30Z")

</div>

Test looks good.

JD

From: Tomas M.  
Sent: Monday, April 20, 2009 9:32 AM  
To: Shri B.; IronRuby External Code R.  
Cc: removed\_email\_address@domain.invalid  
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: removed\_email\_address@domain.invalid  
Subject: Review: Array#hash and irtests.bat

> <https://github.com/shri-zz/ironruby/commit/7f3d766216c2fa533e208ac2a44b8de39cb03f7c>
>
> Also updated ArraySpecs.recursive\_array to produce a cycle of length 3. Previous…ly, 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.

- 

```
    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.

> <https://github.com/shri-zz/ironruby/commit/a011753ebab46652992a0d82a94437811f456381>
>
> Changed irtests.bat to only use two "mspec" tasks so that "irtest -par" will spa…wn 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

- 

```
    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
