Test-Fatal reviews

RSS | Module Info

Test-Fatal (0.010) ****

Test::Fatal is a good replacement for Test::Exception. I find myself using it a lot. It is very low in dependencies (only non-core dependency is Try::Tiny), which makes it quite easy to bundle along in "inc".

The one missing feature which I find myself wishing for occasionally is the ability to test the exception for a string of Perl code. (Consider the two forms of Perl's "eval" keyword.)

Test-Fatal (0.003) *****

Test::Fatal is an excellent replacement for Test::Exception. It provides a clear API that will work with anything you throw at it, whereas Test::Exception occasionally causes problems due to its (almost entirely) unneeded use of Sub::Uplevel.

The module's API is simultaneously simpler and more flexible than T:E, providing one common function, exception { ... }, which you can combine with any testing function provided by Test::More or its confederates.

Test-Fatal (0.003) *****

I know this is still young, but its awesomeness is self evident when you use it. Test::Exception was good, but often lacking, to the point I often found myself injecting one-off utility functions in various tests to work around its failings.

Not to mention, to work with T::E you need a perfect memory, or you have to keep checking the POD to work out how it works.

Test::Fatal has none of these issues, because one function is easy to remember, easy enough to use every time, and its simple enough its easy to compose in-line into things.

Although T::E may be shorter in invocation, the psychological debit of using it is too high, and you can do most of what it does with combinations of 'is', and 'exception{ }' , combining the 2 things you know to provide a common goal, instead of needing to learn 3 things.

Additionally, foo { } @args style syntax looks frankly sodding horrible in test code, that missing "," always bites me in the ass.