[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[proposal] Test::Unit name of failing method

Simon Strandgaard

11/3/2003 9:01:00 PM

I have some code which sometimes goes into endless recursion,
so that I have to do CTRL-C to stop it.

The call-stack is very deep, and Test::Unit is only revealing
the top and the bottom of the call-stack (the middle is shown as
[...] dots). The method name is within that part which Test::Unit
hides for me, Thus I cannot determine the name of the failing-method.

It would be really nice if Test::Unit could determine the name
of the failing method.

Any thoughts ?

--
Simon Strandgaard, Ruby-1.8.1preview2


server> ruby test_scanner2.rb
Loaded suite TestScanner2
Started
....................^C./scanner2.rb:234:in `visit_repeat': Interrupt from ./scanner2.rb:225:in `loop'
from ./scanner2.rb:252:in `visit_repeat'
from ./scanner2.rb:31:in `accept'
from ./scanner2.rb:275:in `visit_group_open'
from ./scanner2.rb:56:in `accept'
from ./scanner2.rb:245:in `visit_repeat'
from ./scanner2.rb:225:in `loop'
from ./scanner2.rb:252:in `visit_repeat'
... 13 levels...
from /home/neoneye/stow/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:77:in `start_mediator'
from /home/neoneye/stow/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:51:in `start'
from /home/neoneye/stow/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:26:in `run'
from test_scanner2.rb:148
server>
1 Answer

Simon Strandgaard

11/5/2003 4:23:00 PM

0

On Mon, 03 Nov 2003 22:01:05 +0100, Simon Strandgaard wrote:
[snip]
> It would be really nice if Test::Unit could determine the name
> of the failing method.
>
> server> ruby test_scanner2.rb
> Loaded suite TestScanner2
> Started
> ...................^C./scanner2.rb:234:in `visit_repeat': Interrupt from ./scanner2.rb:225:in `loop'
> from ./scanner2.rb:252:in `visit_repeat'
> from ./scanner2.rb:31:in `accept'
> from ./scanner2.rb:275:in `visit_group_open'
> from ./scanner2.rb:56:in `accept'
> from ./scanner2.rb:245:in `visit_repeat'
> from ./scanner2.rb:225:in `loop'
> from ./scanner2.rb:252:in `visit_repeat'
> ... 13 levels...
> from /home/neoneye/stow/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:77:in `start_mediator'
> from /home/neoneye/stow/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:51:in `start'
> from /home/neoneye/stow/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:26:in `run'
> from test_scanner2.rb:148
> server>

No response.. Apparently its only me which has this kinds of wishes ?
Or perhaps messages on comp.lang.ruby never reaches ruby-talk ?

Author of Test::Unit (Nathaniel Talbott) are you reading this ?

I guess its possible, but I have no idea how to do it.
any ideas on how to implement this stuff, is appreciated ?

--
Simon Strandgaard