From: Ryan King Date: 2002-08-29T10:32:49+09:00 Subject: Re: CompareByValue On 2002.08.29, Dossy wrote: > > [...] http://www.rubygarden.org/ruby?CompareByValue > I don't think my solution to make the test pass is a "hack" that > just makes the test pass, but the whole class of tests involving > recursion, to pass. It causes them to return "equal", yes. =) I added two assert_not_equal's that I should have had originally. Maybe I'll break down and just add some more thorough tests. I was trying to keep the size down so the intention of the module was clearer... but I guess that was a silly tradeoff. Also, I noticed someone added a version that uses a global variable to keep track of "seen"s. This version passes all tests, but isn't thread-safe... which is a limitation I'd like to overcome. We could easily fix it by using thread-specific storage, but the more interesting question: How would we devise a test that verifies the thread-safety? I suppose we could come up with something involving Thread.pass... - Ryan King