On Mon, Nov 09, 2009 at 02:24:11AM -0800, Ovid wrote: > --- On Mon, 9/11/09, Ovid <publiustemp-perl...@yahoo.com> wrote: > > > From: Ovid <publiustemp-perl...@yahoo.com> > > > The *only* use I've ever had for use_ok() has been in a > > t/00-load.t test which attempts to load all modules and does > > a BAIL_OUT if it fails. I'm sure there are other use > > cases, but if that's the only one, it seems a very, very > > slim justification for a fragile code. > > Thinking about this more, what about a compile_ok()? It merely > asserts that the code compiles (in an anonymous namespace, perhaps?), > but doesn't make any guarantees about you being able to even use the > code -- just that it compiles. It wouldn't need to be done at BEGIN > time, nor would it necessarily require a "or die" after it, since its > availability is not guaranteed (though that would be problematic as > cleaning a namespace is also fragile). > > Just tossing out ideas here. >
compile_ok() would certainly be interesting with scripts shipped with a module, that usually have very little meat that needs testing (since most of the work is done in the modules), but that one would at least check that they compile. -- Philippe Bruhat (BooK) Everyone's life seems easier from the outside. (Moral from Groo The Wanderer #45 (Epic))