On Mon, Nov 11, 2002 at 07:56:32PM -0800, Dave Whipp wrote: > "Andrew Wilson" <[EMAIL PROTECTED]> wrote >> Perl's tests are built on Test::More, it uses ok() and is() not >> assert(). If we're going to be doing test cases for perl 6 then we >> should do them using perl's standard testing format (i.e. Test::More, >> Test::Harness, etc.) > > I would argue that we should write our tests using perl6's standard > format -- and we need to define that format. There may be a good > argument for using the perl5 standards; but we should explore the > alternatives. "assert" is a generally accepted term: I'm not sure > why perl should be different.
You could argue that, but I would say that perl 6 already has someone responsible for making sure it gets tested properly. As far as I know, when Mike wrote Test::More and redesigned Test::Harness he had perl 6 in mind. There is already a list for people interested in testing perl6. perl-qa is perl 6's testing list. Mike asked them not to put the 6 in the name because he wanted to raise standards of testing in perl 5 and thought a 6 would put people off. If there is a case for replacing the testing mechanism then you probably need to argue it on perl-qa. >> If your program can't do basic I/O it's probably pretty broken. Even >> if we we're to only rely on the test modules, they also need to be >> able to communicate with the outside world. > > My day-job is ASIC verification: in a previous job I tested > microprocessor cores. We generally found mechanisms to communicate > pass/fail without requiring any IO capability. A common method is to > use the programm counter -- if we execute the instruction at address > 0x123456, then exit as a PASS; if we reach 0x654321, then fail. (we > used the assembler to get the addresses of specific pass/fail labels). Ok, I concede you don't need print to do this stuff. Standard perl tests (perl 5 current practice) generally don't use print anyway, they would do use Test::More Tests => 1; my $a = some_function('foo'); is($a, 5, "some_function frobnitzes foo correctly"); or: use Test::More Tests => 1; is(some_function('foo''), 5, "some_function frobnitzes foo correctly"); which may have been what you wanted to rename as assert. > We don't need to go to these extremes for perl testing, because we > have an exit(int) capability. exit(0) means pass: anything else > (including timeout) is a fail. > > The fact that we don't need C<print> is not a good argument for not > using it. Perl tests should assume that Parrot works! Was the test you quoted a parrot test? If it is it probably needs to be lower level and can't use the full gamut of the Testing suite. There's a case to be made for defining a documentation format that test cases can be defined in and extracted from. I think though that we need to be aware that work on perl 6 testing has already been done and make sure the stuff we produce is useful. There's little point in producing tests in the wrong format. andrew -- Libra: (Sept. 23 - Oct. 23) You will have one of the worst days of your life next week. However, since it's one of several thousand worst days of your life, it's not all that significant.
msg23979/pgp00000.pgp
Description: PGP signature