On Tue, Dec 07, 2004 at 09:07:36AM -0000, Clayton, Nik wrote: > There's no way to tell from the first argument whether or not the second > argument exists. If it doesn't exist you can't even safely check for its > existence. > > To give a printf() example, something like this: > > int n = 42; > printf("%d %d\n", n); > > will fail, because you haven't supplied enough arguments. printf() will > fail off the end of its argument list and segfault.
Oh yeah. Ick. > > I hope you're not emulating Test::More's exit code == # of > > tests failed "feature" that I'm planning on getting rid of. > > Right now that's exactly what I'm doing. The test suite for libtap > consists of a series of Test::More test files and a series of C files that > try and test exactly the same thing. > > For each one of these I make sure that the output from libtap is identical > to the output from Test::More (modulo differences in reporting which > file/line a test failed on) and that the exit code is identical. I would recommend against emulating this feature. I haven't found it useful and haven't found anyone who has. It was put in as a very simple mechanism to determine if your test failed or not without having to parse the output. This was back when there was no way to run Test::Harness and programmaticly get the results. You might want to throw it in as an option. I'm going to change Test::More so it no longer mucks with the exit code by default, you'll have to turn this feature on. -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern/ If you can't remember, the Claymore is pointed at you.