Assert stacks, does anyone else do this?

0 views
Skip to first unread message

Michael G Schwern

unread,
Sep 6, 2010, 7:37:45 PM9/6/10
to test-mo...@googlegroups.com
Easily the most complicated part of Test::Builder2 has been assert stacking.
That is the idea that you can write asserts with other asserts and yet keep
track of where the top of the stack is, where the user originally called the
assert, so you can both report the failure from the perspective of the caller
(like Carp) and detect when a stack of asserts is done letting everyone in the
stack have their chance.

Does any other testing system do this? If they do, how do they do it? If
not, what do they do? Throw a stack trace and let the user figure it out?
Call an assert, catch and rethrow if it fails?

I wonder both to see if there's a better way to do assert stacking and also if
there's a better paradigm to accomplish good failure reporting and "end of
assert" actions.


--
I'm pale as Formica, social skills stunted small. But I'm accurate
like a pica, I know the capital of Nepal. I'm the nemesis of error,
dreadful diction fears my skills, more inquisitive than Jim Lehrer,
snottier than Beverly Hills.
-- I.L.O.P. Secret Rap http://goats.com/archive/020830.html

Reply all
Reply to author
Forward
0 new messages