Generally I prefer to use simple constructs, especially in tests. However, sometimes a well-defined wrapper is better. Something like Test::Warn:
warnings_like { my_fucntion() } [ {carped => qr/deprecated.*our_function/} ], "Warning issued, alter +native suggested";
This can be written with $SIG{__WARN__} and like, but why bother? The intention is clear from this code.
My proposed "test that condition holds for all adjacent values in an array" looks pretty well-defined to me. And if it's insufficient, there's always subtest and a for loop...
In reply to Re^2: A proper name for is_sorted function that can check more than just sorting order?
by Dallaylaen
in thread A proper name for is_sorted function that can check more than just sorting order?
by Dallaylaen
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |