Re: [ANNOUNCE] Test::Sims

2009-06-29 Thread Michael G Schwern
Ovid wrote: > First feature request: automatic Moose support to build random data which > conforms to Moose constraints :) (Yes, I know it's much, much harder than it sounds). Hello, what? -- Just call me 'Moron Sugar'. http://www.somethingpositive.net/sp05182002.shtml

Re: [ANNOUNCE] Test::Sims

2009-06-29 Thread Ovid
- Original Message > From: Michael G Schwern > > Sim functions can combine together to make more complicated sims. > > package Sim::Person; > > use Test::Sims; > > sub sim_person { > my %defaults = ( > name => rand_name(), > age =>

Re: Subtest fail with singletons

2009-06-29 Thread Ovid
- Original Message > From: Michael G Schwern > > Ovid wrote: > > > > I've generally been extremely pleased with how robust 'local > > $hash->{value}' > is, > > but you can't localize lexical variables. > > The Test::Builder singleton is now a package global. Given that I think I ma

Re: prove is not generating archive when test bails out.

2009-06-29 Thread Ovid
- Original Message > From: Michael Peters > > > When running tests with prove -a file.tar.gz it nicely creates the > > archive file > > but if the test bails out the archive file is not created at all. > > > > Is this a feature or a bug ? > > Sounds like a bug. I'm not sure what pat

[ANNOUNCE] Test::Sims

2009-06-29 Thread Michael G Schwern
Folks might remember my talk at, I think it was YAPC 2008, "Generating Test Data With The Sims". http://schwern.org/talks/Generating%20Test%20Data%20With%20The%20Sims.pdf It was about building up little functions to generate random, but valid, data and then using those to make random, but valid, o

Re: Subtest fail with singletons

2009-06-29 Thread Michael G Schwern
Ovid wrote: > - Original Message > >> From: Michael G Schwern >> %$Test = %$child; Watch out for edge cases of when subtest() dies, make sure the parent's guts get put back. >>> "local" should be good for doing that right? >> Normally, yes. local $Test will

Re: Buffered parallel subtests

2009-06-29 Thread Mark Morgan
Would a lock on STDOUT not achieve the same effect, 1/ without having to introduce new syntax and 2/ while appearing more responsive to the user? You'd also still potentially get output conflated, as atomic write size is a fixed size (I believe in the order of 2-4K on most systems, looks to be 2K

Re: Buffered parallel subtests

2009-06-29 Thread David E. Wheeler
On Jun 29, 2009, at 12:39 PM, Ovid wrote: if the 'some subtest' subtest didn't emit anything until that summary 'ok 1' line, can we safely run subtests in parallel without worrying about whether or not their output overlaps? Not unless you can put a lock on the file handle. Or, I guess, you

Re: prove is not generating archive when test bails out.

2009-06-29 Thread Michael Peters
Gabor Szabo wrote: When running tests with prove -a file.tar.gz it nicely creates the archive file but if the test bails out the archive file is not created at all. Is this a feature or a bug ? Sounds like a bug. I'm not sure what path a bail out follows, but TAP::Harness::Archive overrides

prove is not generating archive when test bails out.

2009-06-29 Thread Gabor Szabo
When running tests with prove -a file.tar.gz it nicely creates the archive file but if the test bails out the archive file is not created at all. Is this a feature or a bug ? Gabor

looking for CPANTS (co-) maintainers

2009-06-29 Thread Thomas Klausner
Hi! See over there: http://use.perl.org/~domm/journal/39189 -- #!/usr/bin/perl http://domm.plix.at for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Buffered parallel subtests

2009-06-29 Thread Ovid
Hi all, I hope this idea makes sense. I was thinking about the issue of running subtests in parallel when I thought about the idea of a "buffered subtest". Basically, it would work exactly like a normal subtest, but nothing would go to STDOUT or STDERR until the final line (the non-nested test

Re: Subtest fail with singletons

2009-06-29 Thread Ovid
- Original Message > From: Michael G Schwern > > >> %$Test = %$child; > >> > >> Watch out for edge cases of when subtest() dies, make sure the > >> parent's guts > >> get put back. > > > > "local" should be good for doing that right? > > Normally, yes. local $Test will localize t

Re: Subtest fail with singletons

2009-06-29 Thread Michael G Schwern
Michael Peters wrote: > Michael G Schwern wrote: > >> A simple strategy might be to just replace the global singleton with the >> child's guts at the start of a subtest() and then back out again at >> the end. >> >> %$Test = %$child; >> >> Watch out for edge cases of when subtest() dies, make

Re: Subtest fail with singletons

2009-06-29 Thread Ovid
- Original Message > From: Michael G Schwern > > A simple strategy might be to just replace the global singleton with the > child's guts at the start of a subtest() and then back out again at the end. > > %$Test = %$child; I don't think that the child should ever have knowledge of

Re: Subtest fail with singletons

2009-06-29 Thread Michael Peters
Michael G Schwern wrote: A simple strategy might be to just replace the global singleton with the child's guts at the start of a subtest() and then back out again at the end. %$Test = %$child; Watch out for edge cases of when subtest() dies, make sure the parent's guts get put back. "loc

Re: Subtest fail with singletons

2009-06-29 Thread Michael G Schwern
Ovid wrote: > - Original Message > >> From: David E. Wheeler >> To: Ovid >> Cc: perl-qa@perl.org >> Sent: Monday, 29 June, 2009 17:38:15 >> Subject: Re: Subtest fail with singletons >> >> On Jun 29, 2009, at 2:19 AM, Ovid wrote: >> >>>my $Test = Test::Builder->new; >>> >>> If every

Re: Subtest fail with singletons

2009-06-29 Thread Ovid
- Original Message > From: David E. Wheeler > > > And Test::Exception and many, many other Test:: modules. It's a very > > common > pattern and getting all authors to agree to fix those modules is a dubious > strategy, I think. > > /me shrug. If their modules fail with a new versio

Re: Subtest fail with singletons

2009-06-29 Thread David E. Wheeler
On Jun 29, 2009, at 9:50 AM, Ovid wrote: And Test::Exception and many, many other Test:: modules. It's a very common pattern and getting all authors to agree to fix those modules is a dubious strategy, I think. /me shrug. If their modules fail with a new version of T::B, they have to fix

Re: Subtest fail with singletons

2009-06-29 Thread Ovid
- Original Message > From: David E. Wheeler > To: Ovid > Cc: perl-qa@perl.org > Sent: Monday, 29 June, 2009 17:38:15 > Subject: Re: Subtest fail with singletons > > On Jun 29, 2009, at 2:19 AM, Ovid wrote: > > >my $Test = Test::Builder->new; > > > > If every test function simply

Re: Subtest fail with singletons

2009-06-29 Thread David E. Wheeler
On Jun 29, 2009, at 2:19 AM, Ovid wrote: my $Test = Test::Builder->new; If every test function simply had that line in the function, rather than trying to share this across all test functions, the code would work fine. Not sure of the best way of handling this, but it's annoying as h

Re: Subtest fail with singletons

2009-06-29 Thread Ovid
Er, I should probably make it clear that Test::Builder relies on a singleton internally, but it's not really the cause of this bug. Subtests cause the Test::Builder->new singleton to temporarily return a "child" version of TB. It's trying to reuse the TB variable in Test::XML (and other testing

Subtest fail with singletons

2009-06-29 Thread Ovid
The following subtest code fails badly: use Test::More tests => 2; use Test::XML; ok 1; subtest 'FAIL!' => sub { plan tests => 1; is_xml '', '', 'Singleton fail'; }; __END__ xml.t .. 1..2 ok 1 1..1 Cannot run test (Singleton fail)