in reply to Re: A proper name for is_sorted function that can check more than just sorting order?
in thread A proper name for is_sorted function that can check more than just sorting order?

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

  • Comment on Re^2: A proper name for is_sorted function that can check more than just sorting order?
  • Download Code