Re: [Module::Build] Yikes! Module::Build 0.2804 produces META.yml with version objects

2006-07-20 Thread Adam Kennedy
Gee, I love YAML. (Sigh.) You and me both. It's at this point I make very quiet noises about YAML::Tiny, and how it only supports ordinary data, so things like objects and circulars and other crazy things can't happen. It's not "done" yet, but the basics all should work. You might want

Re: planning at the end

2006-07-20 Thread Gabor Szabo
On 7/21/06, Michael G Schwern <[EMAIL PROTECTED]> wrote: On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: > If I am not mistaken the problem with no_plan is that the test script > might exit before actually running all the tests you wanted and Harness > won't notice it. PS In all my years of

Re: Test::WWW::Mechanize page_internal_links_ok

2006-07-20 Thread Gabor Szabo
On 7/21/06, Andy Lester <[EMAIL PROTECTED]> wrote: On Jul 20, 2006, at 4:42 PM, Gabor Szabo wrote: > What would be the correct and easy way to test only links that are > internal to > the site. Maybe a > > page_internal_links_ok() method? How would you have it determine what's internal? When

Re: [Module::Build] Yikes! Module::Build 0.2804 produces META.yml with version objects

2006-07-20 Thread Ken Williams
On Jul 20, 2006, at 9:07 PM, David Golden wrote: $node is a YAML::Node and the EXISTS function only checks for things stored in the NODE property, not the HASH property. I'm not sure exactly what those two are supposed to be representing, but the point is that the "exists $node->{versio

Re: [Module::Build] Yikes! Module::Build 0.2804 produces META.yml with version objects

2006-07-20 Thread David Golden
John Peacock wrote: David Golden wrote: [cc'd to perl-qa for awareness of the issue] The switch to version objects in Module::Build means that the generated META.yml now has this: Is this with or without YAML itself loaded (so I know where to start)? I did a little digging and this line do

Re: planning at the end

2006-07-20 Thread A. Pagaltzis
* Michael G Schwern <[EMAIL PROTECTED]> [2006-07-21 01:30]: > On 7/20/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: > >use Test::More; > > > >plan tests => my $tests; > > > >{ > >require_ok( 'MyModule' ); > >my $obj = MyModule->new(); > >isa_ok( $obj, 'MyModule' );

Re: planning at the end

2006-07-20 Thread Fergal Daly
On 21/07/06, chromatic <[EMAIL PROTECTED]> wrote: On Thursday 20 July 2006 16:57, Fergal Daly wrote: > On 21/07/06, chromatic <[EMAIL PROTECTED]> wrote: > > Test an XS component. Segfaults don't call done_testing_now(). > > > > Yes, that happened to me last night. Yes, I had 'no_plan' active.

Re: planning at the end

2006-07-20 Thread chromatic
On Thursday 20 July 2006 16:57, Fergal Daly wrote: > On 21/07/06, chromatic <[EMAIL PROTECTED]> wrote: > > Test an XS component. Segfaults don't call done_testing_now(). > > > > Yes, that happened to me last night. Yes, I had 'no_plan' active. Yes, > > I noticed it as a happy accident, thinkin

Re: planning at the end

2006-07-20 Thread Fergal Daly
On 21/07/06, chromatic <[EMAIL PROTECTED]> wrote: On Thursday 20 July 2006 16:01, Michael G Schwern wrote: > On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: > > If I am not mistaken the problem with no_plan is that the test script > > might exit before actually running all the tests you want

Re: planning at the end

2006-07-20 Thread chromatic
On Thursday 20 July 2006 16:01, Michael G Schwern wrote: > On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: > > If I am not mistaken the problem with no_plan is that the test script > > might exit before actually running all the tests you wanted and Harness > > won't notice it. > PS In all my

Re: planning at the end

2006-07-20 Thread Michael G Schwern
On 7/20/06, A. Pagaltzis <[EMAIL PROTECTED]> wrote: use Test::More; plan tests => my $tests; { require_ok( 'MyModule' ); my $obj = MyModule->new(); isa_ok( $obj, 'MyModule' ); } BEGIN { $tests += 3 } Pretty sneaky. This is now in the FAQ. http://pe

Re: planning at the end

2006-07-20 Thread Michael G Schwern
On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: If I am not mistaken the problem with no_plan is that the test script might exit before actually running all the tests you wanted and Harness won't notice it. PS In all my years of testing I have never been bitten by this in the real world whi

Re: planning at the end

2006-07-20 Thread Michael G Schwern
On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: If I am not mistaken the problem with no_plan is that the test script might exit before actually running all the tests you wanted and Harness won't notice it. That's what I wanted to avoid. So maybe if there was a mode where Test::Builder did n

Yikes! Module::Build 0.2804 produces META.yml with version objects

2006-07-20 Thread David Golden
[cc'd to perl-qa for awareness of the issue] The switch to version objects in Module::Build means that the generated META.yml now has this: name: Class-InsideOut version: !!perl/hash:Module::Build::Version original: 1.00 version: - 1 - 0 That can't be good for backwards compatibil

Re: planning at the end

2006-07-20 Thread Michael G Schwern
On 7/20/06, Tyler MacDonald <[EMAIL PROTECTED]> wrote: Exactly. :-) Take a look at, for instance, IPC::Run's test cases... an array of sub{} blocks, some of which get skipped over on certain OS'es. It'd be really easy to accidentally put to ok()'s in one sub{} block and screw up the count

Re: use Tests; # ?

2006-07-20 Thread chromatic
On Thursday 20 July 2006 14:46, Fergal Daly wrote: > Your example does not produce any incorrect output. Perhaps "incorrect" is a very poor word choice, but I certainly consider the stack trace behavior potentially unhelpful and potentially misleading. I will make one more attempt to demonstrat

Re: planning at the end

2006-07-20 Thread A. Pagaltzis
* Tyler MacDonald <[EMAIL PROTECTED]> [2006-07-20 21:15]: > Take a look at, for instance, IPC::Run's test cases... an array > of sub{} blocks, some of which get skipped over on certain > OS'es. It'd be really easy to accidentally put to ok()'s in one > sub{} block and screw up the count. In the co

Re: planning at the end

2006-07-20 Thread A. Pagaltzis
* Adriano Ferreira <[EMAIL PROTECTED]> [2006-07-20 22:10]: > use Test::More; > > subplan tests => 2; > > require_ok('MyModule'); > my $obj = MyModule->new(); > isa_ok($obj, 'MyModule'); > > my @cities = ("Brasilia", "Rio de Janeiro", "Salvador"); > > subplan tests => [EMAIL PROTECTED]; > > fo

Re: use Tests; # ?

2006-07-20 Thread Fergal Daly
On 20/07/06, chromatic <[EMAIL PROTECTED]> wrote: On Thursday 20 July 2006 13:50, Fergal Daly wrote: > Example code please. You *quoted* my example code in multiple messages, including this one. Your example does not produce any incorrect output. Nothing I have seen in any thread has produced

Re: Test::WWW::Mechanize page_internal_links_ok

2006-07-20 Thread Andy Lester
On Jul 20, 2006, at 4:42 PM, Gabor Szabo wrote: What would be the correct and easy way to test only links that are internal to the site. Maybe a page_internal_links_ok() method? How would you have it determine what's internal? -- Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM

Test::WWW::Mechanize page_internal_links_ok

2006-07-20 Thread Gabor Szabo
While using page_link_ok it checks all the links on the page, including those that point to external sites. It is bth unpolite - why hit their site every time I run my test script and when I am working off line it generates false errors. What would be the correct and easy way to test only links

Re: use Tests; # ?

2006-07-20 Thread chromatic
On Thursday 20 July 2006 13:50, Fergal Daly wrote: > Example code please. You *quoted* my example code in multiple messages, including this one. > You're saying there's a situation where using > $Level produces the incorrect output. I'm saying there isn't. I don't know what else to call a stac

Re: stack traces

2006-07-20 Thread Fergal Daly
On 20/07/06, Randy W. Sims <[EMAIL PROTECTED]> wrote: Fergal Daly wrote: > I have svn commit access but no idea how to use it prooperly so > attached is a 5 line patch to Test::Builder to make it say things like I think I would vote for this, but maybe with a setting or environment variable to e

Re: use Tests; # ?

2006-07-20 Thread Fergal Daly
On 20/07/06, chromatic <[EMAIL PROTECTED]> wrote: On Thursday 20 July 2006 02:59, Fergal Daly wrote: > > There already exist two long-accepted, well-understood, coded, tested, > > and debugged ways to answer both questions. I don't see the value in > > adding a third, especially when it's not s

Re: planning at the end

2006-07-20 Thread David Wheeler
On Jul 20, 2006, at 13:38, Adriano Ferreira wrote: When I made changes, I usually decreased radically the size of the sample to not be drowned in "not ok". When everything was alright, I returned to sample sizes of 100 or so. It would have been easier if I could count with simple expressions and

Re: planning at the end

2006-07-20 Thread Adriano Ferreira
On 7/20/06, chromatic <[EMAIL PROTECTED]> wrote: I don't understand this. I have a Vim macro that switches between: use Test::More 'no_plan'; ... and: use Test::More tests => 1; When I work on a test suite, I switch off the plan. When I finish, I look at the number of tests

Re: planning at the end

2006-07-20 Thread Gabor Szabo
On 7/20/06, Andy Lester <[EMAIL PROTECTED]> wrote: On Jul 20, 2006, at 2:45 PM, Adriano Ferreira wrote: > Ok, that's weird. But it may occasionally have usefulness. Gabor > started the thread with the idea of having a test against web pages, > which he doesn't know how many at the beginning, bu

Re: planning at the end

2006-07-20 Thread chromatic
On Thursday 20 July 2006 13:05, Adriano Ferreira wrote: > Sometimes, I would like to > have something like that below so that I don't need to think about how > to compute the number of tests beforehand I don't understand this. I have a Vim macro that switches between: use Test::More 'no

Re: planning at the end

2006-07-20 Thread Adriano Ferreira
On 7/20/06, Hakim Cassimally <[EMAIL PROTECTED]> wrote: Restructuring your tests (moving OS-dependent, skippable sections to their own scripts for example) might make the requirement for a deferred plan seem less important ? Writing tests is harder. Writing code is more rewarding to the heart.

Re: planning at the end

2006-07-20 Thread Andy Lester
On Jul 20, 2006, at 2:45 PM, Adriano Ferreira wrote: Ok, that's weird. But it may occasionally have usefulness. Gabor started the thread with the idea of having a test against web pages, which he doesn't know how many at the beginning, but which may be verified at the end - his count against Te

Re: planning at the end

2006-07-20 Thread Adriano Ferreira
On 7/20/06, Andy Lester <[EMAIL PROTECTED]> wrote: On Jul 20, 2006, at 2:19 PM, Adriano Ferreira wrote: > was emitted, it would mean the test *should* tell the plan at the end. > If it doesn't, it is a failure. I don't think this is no protection. > It may be an improvement to 'no_plan' in cert

Re: planning at the end

2006-07-20 Thread Adriano Ferreira
On 7/20/06, Adriano Ferreira <[EMAIL PROTECTED]> wrote: When something like > >>> use Test::More tests => 'defer'; was emitted, it would mean the test *should* tell the plan at the end. If it doesn't, it is a failure. I don't think this is no protection. It may be an improvement to 'no_pl

Re: planning at the end

2006-07-20 Thread Andy Lester
On Jul 20, 2006, at 2:19 PM, Adriano Ferreira wrote: was emitted, it would mean the test *should* tell the plan at the end. If it doesn't, it is a failure. I don't think this is no protection. It may be an improvement to 'no_plan' in certain circumstances. What circumstance would that be? --

Re: planning at the end

2006-07-20 Thread Adriano Ferreira
On 7/20/06, Michael Peters <[EMAIL PROTECTED]> wrote: >> What benefit would that give? plan() is nice because it provides protection >> against you test script exiting prematurely. > > > The exact same benefit as doing a 'plan' at the > beginning, except this would work for scripts that don't k

Re: planning at the end

2006-07-20 Thread Tyler MacDonald
Michael Peters <[EMAIL PROTECTED]> wrote: > > If the calculated result used in the > > 'plan' at the end does not match the number of tests actually run, then you > > know you've got a problem with your test code. > > > > So this gives you protection against not being able to count? Exac

Re: planning at the end

2006-07-20 Thread Michael Peters
Tyler MacDonald wrote: > Michael Peters <[EMAIL PROTECTED]> wrote: >>> use Test::More tests => 'defer'; >>> >>> and then >>> >>> plan past_tests => $n; >> What benefit would that give? plan() is nice because it provides protection >> against you test script exiting prematurely. > >

Re: Real Kwalitee, or please stop spending time thinking about CPANTS

2006-07-20 Thread Jonathan Rockway
4) Adopt a Perl Mongers group. None around. Andy means adopt a PM mailing list. Mention things like the M::I issue to mongers groups that may not have anyone on perl-qa or the perl6 lists. -- Jonathan Rockway

Re: planning at the end

2006-07-20 Thread Tyler MacDonald
Michael Peters <[EMAIL PROTECTED]> wrote: > > use Test::More tests => 'defer'; > > > > and then > > > > plan past_tests => $n; > > What benefit would that give? plan() is nice because it provides protection > against you test script exiting prematurely. The exact same benefit as do

Re: planning at the end

2006-07-20 Thread Michael Peters
Adriano Ferreira wrote: > It would be something different, like > > use Test::More tests => 'defer'; > > and then > > plan past_tests => $n; What benefit would that give? plan() is nice because it provides protection against you test script exiting prematurely. -- Michael Peter

Re: planning at the end

2006-07-20 Thread Adriano Ferreira
On 7/20/06, Michael G Schwern <[EMAIL PROTECTED]> wrote: On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: > On the other hand I can count them during the test and can tell > Test::More that I was actually expecting $n tests. This is exactly how no_plan works. use Test::More 'no_plan'; Te

Re: planning at the end

2006-07-20 Thread Michael G Schwern
On 7/20/06, Gabor Szabo <[EMAIL PROTECTED]> wrote: As this is a live site with user created pages I don't know up front how many pages I am going to test thus I don't know the number of tests before I run them. On the other hand I can count them during the test and can tell Test::More that I was

Re: use Tests; # ?

2006-07-20 Thread chromatic
On Thursday 20 July 2006 02:59, Fergal Daly wrote: > > There already exist two long-accepted, well-understood, coded, tested, > > and debugged ways to answer both questions. I don't see the value in > > adding a third, especially when it's not substantially better than either > > and can be wrong

Re: Kwalitee metric: Community support channels

2006-07-20 Thread Salve J Nilsen
Thomas Klausner wrote: Hi! On Thu, Jul 20, 2006 at 01:56:36PM +0200, Salve J Nilsen wrote: Is there a (public) authoritative META.yml spec describing required, recommended and supported fields? http://module-build.sourceforge.net/META-spec.html Thanks, and it seems there are newer vers

Re: Real Kwalitee, or please stop spending time thinking about CPANTS

2006-07-20 Thread David Landgren
Adam Kennedy wrote: [...] I'd actually love to see some statistics, if we are collecting any, of the "good vs bad" scores for the various kwalitee elements over time. That might give us a better idea of how big an impact there is. Of course, we wouldn't have any stats from before CPANTS exis

Re: Kwalitee metric: Community support channels

2006-07-20 Thread Salve J Nilsen
Salve J Nilsen wrote: Adam Kennedy wrote: The presence of lack thereof is more an indication of the scale and importance of the module, rather than anything you can judge all 10k modules by. I'd rather interpret the presence/lack of community pointers as an indication of how interested that

Re: planning at the end

2006-07-20 Thread Andy Lester
On Jul 20, 2006, at 9:47 AM, Gabor Szabo wrote: Can I somehow do this - promise at the beginning that I will tell my plan at the end. (It should consider it a failuer if I don't give plan in the end.) No. That's not how plans work. Andy -- Andy Lester => [EMAIL PROTECTED] => www.petdance.c

Re: use Tests; # ?

2006-07-20 Thread Fergal Daly
On 20/07/06, Smylers <[EMAIL PROTECTED]> wrote: Fergal Daly writes: > On 20/07/06, chromatic <[EMAIL PROTECTED]> wrote: > > > On Wednesday 19 July 2006 18:10, Fergal Daly wrote: > > > > > > On Thu, Jul 20, 2006 at 12:39:11AM +0100, Fergal Daly wrote: > > > > > > > > > Simple question. Given this

Re: use Tests; # ?

2006-07-20 Thread Fergal Daly
On 20/07/06, Ovid <[EMAIL PROTECTED]> wrote: - Original Message From: Gabor Szabo <[EMAIL PROTECTED]> > I admit, I did not even know that it existed until recently. > I guess I have not read the full documentation of Test::More and Test::Builder > but I assume there are not many that do

Re: Kwalitee metric: Community support channels

2006-07-20 Thread Thomas Klausner
Hi! On Thu, Jul 20, 2006 at 01:56:36PM +0200, Salve J Nilsen wrote: > Is there a (public) authoritative META.yml spec describing required, > recommended and supported fields? http://module-build.sourceforge.net/META-spec.html -- #!/usr/bin/perl http://domm.zsi

Re: use Tests; # ?

2006-07-20 Thread Smylers
Fergal Daly writes: > On 20/07/06, chromatic <[EMAIL PROTECTED]> wrote: > > > On Wednesday 19 July 2006 18:10, Fergal Daly wrote: > > > > > > On Thu, Jul 20, 2006 at 12:39:11AM +0100, Fergal Daly wrote: > > > > > > > > > Simple question. Given this code: > > > > > > > > > > sub foo { > > > > >

Re: Kwalitee metric: Community support channels

2006-07-20 Thread Salve J Nilsen
Adam Kennedy wrote: Salve J Nilsen wrote: Just a wild thought... Would it be useful to check for references to community support channels like mailing lists, IRC channels, public bug trackers and official web pages? One way to do this could be to look for relevant keywords in the META.yml

Re: Real Kwalitee, or please stop spending time thinking about CPANTS

2006-07-20 Thread Adam Kennedy
I've heard people commenting variants of "people will ignore perfectly good modules unless they have score Foo" or "people will use crap modules just because they have score Foo" - but I've never actually seen it happen in Real Life. Has anybody? Just a long as we don't show the CPANTS score

Re: Lessons from the test function parameter placement quibbles?

2006-07-20 Thread Jonathan Rockway
This is partially true, but this is the beginning of a slippery slope down to: $i++ # increment $i by one Things like can_ok($foo, "bar") are obvious on the surface -- but it's good practice to document why you care that $foo can "bar", right? Regards, Jonathan Rockway (My mind idly wonders

Re: planning at the end

2006-07-20 Thread Gabor Szabo
I have a nasty workaround. # at the beginning my $test_allowance = 100; plan tests => $test_allowance; # run the tests here and for each test also execute $test_allowance--; # in the end ok(1) while $test_allowance--; I really hope there is a nicer way to do it. Gabor http://www.szabgab.

Re: use Tests; # ?

2006-07-20 Thread Fergal Daly
On 20/07/06, chromatic <[EMAIL PROTECTED]> wrote: On Wednesday 19 July 2006 18:10, Fergal Daly wrote: > On 20/07/06, chromatic <[EMAIL PROTECTED]> wrote: > > On Thu, Jul 20, 2006 at 12:39:11AM +0100, Fergal Daly wrote: > > > Simple question. Given this code: > > > > > > sub foo { > > > my $t

planning at the end

2006-07-20 Thread Gabor Szabo
While testing a *live* web site I crawl through several pages. For each page I would like to do some tests (e.g. it has a link to home, its HTML is valid, etc.) As this is a live site with user created pages I don't know up front how many pages I am going to test thus I don't know the number of t

Re: some CPANTS news

2006-07-20 Thread Thomas Klausner
Hi! On Thu, Jul 20, 2006 at 12:17:02AM +0200, Thomas Klausner wrote: > Please note the for the next few hours cpants.perl.org will show > slightly strange results, as a big reindexing is currently happending. It's finished by now. Here's a list of dists failing the new Module::Install metric:

Re: use Tests; # ?

2006-07-20 Thread Ovid
- Original Message From: Gabor Szabo <[EMAIL PROTECTED]> > I admit, I did not even know that it existed until recently. > I guess I have not read the full documentation of Test::More and Test::Builder > but I assume there are not many that do. > > [regarding documentation of $Test::Build

Re: Real Kwalitee, or please stop spending time thinking about CPANTS

2006-07-20 Thread Adrian Howard
On 19 Jul 2006, at 08:18, Steffen Mueller wrote: Andy Lester schrieb: At this point, CPANTS rules are getting into the realm of purely self-pleasuring. If more than a dozen people outside of this small enclave of people cares whether a module gets a 16 or 17, I'll be shocked. Personall

Re: use Tests; # ?

2006-07-20 Thread Gabor Szabo
On 7/20/06, chromatic <[EMAIL PROTECTED]> wrote: The problem with $Level is that people don't use it correctly. You want to solve this by providing another element of code that more people will have to use more frequently and hoping that they use it correctly. I'm not sure that's a good assump