[proposal] Test::Unit name of failing method

  • Thread starter Simon Strandgaard
  • Start date
S

Simon Strandgaard

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

Simon Strandgaard

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top