Simon Strandgaard
10/6/2003 12:53:00 PM
failure 1).. I compare 2 hashes with assert_equal.
If I inspect the hashes they appear to be identical.
But the == operator tells me they are different???
I only use Ruby's native types for the things stored in
the hash. Question: Why does this assertion fail ?
server> ruby test_all.rb
Loaded suite Unnamed TestSuite
Started
........................false
FF
Finished in 0.049179 seconds.
1) Failure!!!
test_one_letter(TestRegex) [./test_regex.rb:29]:
<{1=>[["a", 2]], 2=>[]}> expected but was
<{1=>[["a", 2]], 2=>[]}>
2) Failure!!!
test_sequence(TestRegex) [./test_regex.rb:36]:
<#<Nfa:0x81d2194 @nfa_hash={1=>[["a", 2]], 2=>[["b", 3]], 3=>[]}>> expected but was
<#<Nfa:0x81d225c @nfa_hash={1=>[["a", 2]], 2=>[["b", 3]], 3=>[]}>>
25 tests, 25 assertions, 2 failures, 0 errors
server>
In order to reproduce the problem, you can do a cvs-checkout of
these files.
cvs -d:pserver:anonymous@rubyforge.org:/var/cvs/aeditor login
press enter when promped for a password
cvs -z3 -d:pserver:anonymous@rubyforge.org:/var/cvs/aeditor co projects/experimental/nfa_to_dfa
cd projects/experimental/nfa_to_dfa
cvs up -r 1.2 nfa.rb
cvs up -r 1.2 regex.rb
cvs up -r 1.3 test_regex.rb
in order to execute it then do:
ruby test_regex.rb
--
Simon Strandgaard