Re: Untested modules update: There's more than we thought

2001-12-17 Thread Piers Cawley
"Kurt D. Starsinic" <[EMAIL PROTECTED]> writes: > On Dec 15, Dave Rolsky wrote: >> Ok, so that's a bit off the topic of "why use isa_ok()" but I just don't >> see why people seem to object to the use of Test::More in the core Perl >> tests. I can't see how it couldn't help improve the quality of

Re: Untested modules update: There's more than we thought

2001-12-17 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > On Mon, Dec 17, 2001 at 08:12:43AM +, Piers Cawley wrote: >> >> What's wrong with >> >> >> >> ok ( eval { $foo->isa('Foo') } ); >> >> >> >> or even: >> >> >> >> ok (eval { ref($foo) && $foo->isa('Foo') }); >> > >> > As Kurt already po

Re: Untested modules update: There's more than we thought

2001-12-17 Thread Gerrit P. Haase
Hallo chromatic, Am 2001-12-16 um 19:09 schriebst du: > On Sunday 16 December 2001 02:10, Gerrit P. Haase wrote: > Thanks for the report. >> ../lib/ExtUtils/MM_Cygwin.# Failed test >> (../lib/ExtUtils/MM_Cygwin.t at line 73) # undef >> # doesn't match '(?-

Re: Untested modules update: There's more than we thought

2001-12-17 Thread Gerrit P. Haase
Hallo Michael, Am 2001-12-16 um 21:20 schriebst du: > On Sun, Dec 16, 2001 at 11:09:29AM -0700, chromatic wrote: >> + like( $$out, qr/could not locate your pod2man/, >> + '... should warn if pod2man cannot be located' ); > Gerrit, do you already have a perl installed in the spot

Re: Untested modules update: There's more than we thought

2001-12-17 Thread Michael G Schwern
On Mon, Dec 17, 2001 at 08:12:43AM +, Piers Cawley wrote: > >> What's wrong with > >> > >> ok ( eval { $foo->isa('Foo') } ); > >> > >> or even: > >> > >> ok (eval { ref($foo) && $foo->isa('Foo') }); > > > > As Kurt already pointed out, you can do: > > > > ok( UNIVERSAL::isa($foo

Re: Untested modules update: There's more than we thought

2001-12-17 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > On Sun, Dec 16, 2001 at 02:41:31PM +, Piers Cawley wrote: >> > The equivalent code without isa_ok() would be: >> > >> > my $foo = Foo->new; >> > ok( $foo->isa('Foo') ); >> > >> > except should $foo be unblessed or undef that will explode.

Re: Untested modules update: There's more than we thought

2001-12-16 Thread chromatic
Hello again Gerrit, You know, I didn't put the MOST important line in the block. Here's a better patch. I blame Jeffrey Friedl. :) Any better? -- c --- lib/ExtUtils/~MM_Cygwin.t Sun Dec 16 11:02:04 2001 +++ lib/ExtUtils/MM_Cygwin.t Sun Dec 16 19:59:44 2001 @@ -69,12 +69,17 @@ $args->{

Re: Untested modules update: There's more than we thought

2001-12-16 Thread chromatic
On Sun, 16 Dec 2001 19:30:18 -0700, Benjamin Goldberg wrote: > I think that if "all" we know about the returned type is that it is supposed > to provide some specific interface, it would be more robust to test that the > returned thing actually *does* provide the interface. Agreed. You have my

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Michael G Schwern
On Sun, Dec 16, 2001 at 09:30:18PM -0500, Benjamin Goldberg wrote: > Suppose we have RandomThing->new which randomly returns an instance of > one of a few dozen different classes, which have no relation at all with > each other except a common interface. In such an odd case, don't use isa_ok().

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Benjamin Goldberg
Michael G Schwern wrote: > > On Sun, Dec 16, 2001 at 02:41:31PM +, Piers Cawley wrote: > > Nothing wrong with an adaptor/factory returning something that isn't > > a Foo, so long as it has the same interface. > > That's why its isa_ok() and not ref_ok(). > > On the off chance Foo->new is su

Re: lib.t (was Re: Untested modules update: There's more than we thought)

2001-12-16 Thread Michael G Schwern
On Sun, Dec 16, 2001 at 07:30:37PM +, Nicholas Clark wrote: > > I just thought of a better way. Since all we're testing is that > > lib.pm does the right things to @INC, we can presume that if one of > > require(), do() or use() works, the rest will work. > > Can't we just test what @INC now

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Michael G Schwern
On Sun, Dec 16, 2001 at 02:41:31PM +, Piers Cawley wrote: > Nothing wrong with an adaptor/factory returning something that isn't a > Foo, so long as it has the same interface. That's why its isa_ok() and not ref_ok(). On the off chance Foo->new is supposed to return something that bears no r

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Michael G Schwern
On Sun, Dec 16, 2001 at 11:09:29AM -0700, chromatic wrote: > + like( $$out, qr/could not locate your pod2man/, > + '... should warn if pod2man cannot be located' ); Gerrit, do you already have a perl installed in the spot you're about to put this new one? If so, it might be seein

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Michael G Schwern
On Sun, Dec 16, 2001 at 04:20:33PM +, Nicholas Clark wrote: > Does that mean that it should have its own tests placed in t/lib, so that > they run before ext/ and lib/? Yes, it would be nice if they ran before the rest, but I really don't want to start shuffling tests around this close to 5.8

Re: Untested modules update: There's more than we thought

2001-12-16 Thread chromatic
On Sunday 16 December 2001 02:10, Gerrit P. Haase wrote: Thanks for the report. > ../lib/ExtUtils/MM_Cygwin.# Failed test > (../lib/ExtUtils/MM_Cygwin.t at line 73) # undef > # doesn't match '(?-xism:could not locate your pod2man)' > # Failed test (../li

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Piers Cawley
Michael G Schwern <[EMAIL PROTECTED]> writes: > On Sat, Dec 15, 2001 at 04:09:19AM +0200, Jarkko Hietaniemi wrote: >> I don't get all the different (well, only VMS and Cygwin, so far, but >> I like to nip buds) MM_XXX test suites: won't they be testing pretty >> much the same things? > > Yes, b

Re: Untested modules update: There's more than we thought

2001-12-16 Thread Gerrit P. Haase
Hallo Jarkko, Am 2001-12-15 um 20:47 schriebst du: > On Fri, Dec 14, 2001 at 05:20:24PM -0700, chromatic wrote: >> On Fri, 14 Dec 2001 15:18:43 -0700, Michael G Schwern wrote: >> >> > ExtUtils::MM_Cygwin >> >> Here's a test for that. It could use someone on Cygwin testing it. Tels said >> he

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Michael G Schwern
Thinks like use_ok, require_ok, isa_ok, can_ok, etc... are all functions that I threw into Test::More because I found myself needing them and suspected others did, too. If you prefer to use ok() instead of one of the above special purpose functions, I'm not going to jump up and down and fling poo

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Jarkko Hietaniemi
> Ok, so that's a bit off the topic of "why use isa_ok()" but I just don't > see why people seem to object to the use of Test::More in the core Perl > tests. I can't see how it couldn't help improve the quality of the tests > while providing a standardized way to do the things that all the tests

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Kurt D. Starsinic
On Dec 15, Dave Rolsky wrote: > Ok, so that's a bit off the topic of "why use isa_ok()" but I just don't > see why people seem to object to the use of Test::More in the core Perl > tests. I can't see how it couldn't help improve the quality of the tests > while providing a standardized way to do

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Dave Rolsky
On Sat, 15 Dec 2001, Kurt D. Starsinic wrote: > > my $foo = Foo->new; > > ok( defined $foo && $foo->isa('Foo') ); > > > > which rapidly gets tiresome. > > Or ok(UNIVERSAL::isa(Foo->new, 'Foo')); Under 5.005 it spits out warnings if Foo->new returns undef. Plus you still don't get an

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Kurt D. Starsinic
On Dec 14, Michael Schwern wrote: > Constructors fail often enough that I felt it worthwhile to write a > test function for them. > > You could leave off the test entirely and just trust that you use $foo > later on down in the test and it'll explode there, but its better to > put the point of fa

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Moin, On 15-Dec-01 Jarkko Hietaniemi tried to scribble about: >> Ok, so that's a bit off the topic of "why use isa_ok()" but I just don't >> see why people seem to object to the use of Test::More in the core Perl >> tests. I can't see how it couldn't help impr

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Michael G Schwern
On Sat, Dec 15, 2001 at 11:48:29PM +0100, Tels wrote: > Te"One day Math::Big* will have more tests than Perl;)"ls One day Perl will have more tests than Bit::Vector. 67255 at last count. -- Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/ Perl Quality Assurance

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Paul Johnson
On Sat, Dec 15, 2001 at 11:46:29PM +, Nicholas Clark wrote: > On Sat, Dec 15, 2001 at 05:59:22PM -0500, Michael G Schwern wrote: > > On Sat, Dec 15, 2001 at 11:48:29PM +0100, Tels wrote: > > > Te"One day Math::Big* will have more tests than Perl;)"ls > > > > One day Perl will have more tests

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Michael G Schwern
On Sat, Dec 15, 2001 at 02:19:21PM -0800, Kurt D. Starsinic wrote: > On Dec 15, Dave Rolsky wrote: > > Ok, so that's a bit off the topic of "why use isa_ok()" but I just don't > > see why people seem to object to the use of Test::More in the core Perl > > tests. I can't see how it couldn't help i

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Michael G Schwern
On Sat, Dec 15, 2001 at 11:46:29PM +, Nicholas Clark wrote: > On Sat, Dec 15, 2001 at 05:59:22PM -0500, Michael G Schwern wrote: > > On Sat, Dec 15, 2001 at 11:48:29PM +0100, Tels wrote: > > > Te"One day Math::Big* will have more tests than Perl;)"ls > > > > One day Perl will have more tests

Re: Untested modules update: There's more than we thought

2001-12-15 Thread Jarkko Hietaniemi
On Fri, Dec 14, 2001 at 05:20:24PM -0700, chromatic wrote: > On Fri, 14 Dec 2001 15:18:43 -0700, Michael G Schwern wrote: > > > ExtUtils::MM_Cygwin > > Here's a test for that. It could use someone on Cygwin testing it. Tels said > he would, but apparently got busy. Thanks, applied. -- $jhi+

Re: Untested modules update: There's more than we thought

2001-12-14 Thread Michael G Schwern
On Fri, Dec 14, 2001 at 05:20:24PM -0700, chromatic wrote: > On Fri, 14 Dec 2001 15:18:43 -0700, Michael G Schwern wrote: > > ExtUtils::MM_Cygwin > > Here's a test for that. It could use someone on Cygwin testing it. > Tels said he would, but apparently got busy. Checks out ok on Cygwin98. --

Re: Untested modules update: There's more than we thought

2001-12-14 Thread chromatic
On Fri, 14 Dec 2001 15:18:43 -0700, Michael G Schwern wrote: > ExtUtils::MM_Cygwin Here's a test for that. It could use someone on Cygwin testing it. Tels said he would, but apparently got busy. -- c --- ~MANIFEST Sun Nov 25 19:50:46 2001 +++ MANIFESTSun Nov 25 21:08:01 2001 @@ -930,6

lib.t (was Re: Untested modules update: There's more than we thought)

2001-12-14 Thread Michael G Schwern
On Fri, Dec 14, 2001 at 05:57:06PM -0500, Michael G Schwern wrote: > > #how about use's? > > is( > > `perl "-Mlib=stuff -MYup" -e "print 'ok'"`, > > 'ok', > > 'affects use' > > ); > > A simple way to trick 'use' is to clear the entry from %INC and then > eval "use Yup". I just though

Re: Untested modules update: There's more than we thought

2001-12-14 Thread Jarkko Hietaniemi
On Fri, Dec 14, 2001 at 05:50:16PM -0500, Michael G Schwern wrote: > On Sat, Dec 15, 2001 at 12:21:08AM +0200, Jarkko Hietaniemi wrote: > > On Fri, Dec 14, 2001 at 05:18:43PM -0500, Michael G Schwern wrote: > > > The good news is Nick Clark just wrote a test for Benchmark! The bad > > > news is I

Re: Untested modules update: There's more than we thought

2001-12-14 Thread Michael G Schwern
On Fri, Dec 14, 2001 at 02:48:07PM -0800, Brent Dax wrote: > I don't know what directory this should go into, lib/lib.t I guess. > so I'm not providing a > patch, just pasting the body of lib.t in here. Good enough? > > #!./perl > > use Test::More tests => 3; > use lib 'stuff'; > > #create

Re: Untested modules update: There's more than we thought

2001-12-14 Thread Michael G Schwern
On Sat, Dec 15, 2001 at 12:21:08AM +0200, Jarkko Hietaniemi wrote: > On Fri, Dec 14, 2001 at 05:18:43PM -0500, Michael G Schwern wrote: > > The good news is Nick Clark just wrote a test for Benchmark! The bad > > news is I made the mistake at looking closer at ext/B/ today, so the > > list just g

RE: Untested modules update: There's more than we thought

2001-12-14 Thread Brent Dax
Michael G Schwern: # lib *new* I don't know what directory this should go into, so I'm not providing a patch, just pasting the body of lib.t in here. Good enough? #!./perl use Test::More tests => 3; use lib 'stuff'; #create a directory and a module mkdir('stuff', 0666)

Re: Untested modules update: There's more than we thought

2001-12-14 Thread Michael G Schwern
On Fri, Dec 14, 2001 at 02:26:35PM -0800, Russ Allbery wrote: > I forget where the wiki is. WikiHere http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?UntestedModules -- Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/ Perl Quality Assurance <[EMAIL PROTECTE

Untested modules update: There's more than we thought

2001-12-14 Thread Michael G Schwern
The good news is Nick Clark just wrote a test for Benchmark! The bad news is I made the mistake at looking closer at ext/B/ today, so the list just got bigger and quite a bit harder. There's still some fruit that's below giraffe-level, lib and re. B::Asmdata *new* B::Assembler