Re: Test::Builder->create

2005-03-08 Thread Randy W. Sims
Michael G Schwern wrote: On Tue, Mar 08, 2005 at 10:31:48PM +, Fergal Daly wrote: No, other way around. When a TB instance needs a TB::Counter it just says $tb->counter which, normally, returns a singleton but you can alter counter() so it returns something else. A singleton is a class that o

Re: Test::Builder->create

2005-03-08 Thread Michael Graham
> > Would this make it possible to run many test scripts (each with its own > > plan) within the same perl process? 'Cos that would be nifty. > > Yes. Though beyond testing testing libraries I don't know why you'd want to > do that. Well, all I was going to do was try to shave a few seconds off

Re: Test::Builder->create

2005-03-08 Thread David Golden
I was playfully suggesting that behind simply as an abstraction of what Test::Builder and Test::Harness provide. No way would I inflict that on an end-user! David Ofer Nave wrote: David Golden wrote: Just to be playful with concepts: * Test::Answer -- holds the details of a particular test (pa

Re: Test::Builder->create

2005-03-08 Thread Ofer Nave
David Golden wrote: Just to be playful with concepts: * Test::Answer -- holds the details of a particular test (pass/fail/skip/todo) * Test::Scoresheet -- holds a collection of Test::Answers * Test::Booklet -- sets up a default Test::ScoreSheet object to hold results, creates and maintains new o

Re: Test::Builder->create

2005-03-08 Thread David Golden
chromatic wrote: On the other hand, it doesn't do anything differently with TAP as currently defined, and I share Schwern's case of howling fantods at recommending that people look in Test::Builder's test results list. Out of process interpreting and reporting feels so much nicer. An addendum o

Re: Test::Builder->create

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 03:05:16PM -0800, Michael G Schwern wrote: > > A singleton is a class that only ever has 1 instance in existence. If there > > can be multiple instances of TB::Counter or TB::Run then by definition > > neither of them are singletons. Conversely if there is only ever 1 instan

Re: Test::Builder->create

2005-03-08 Thread David Golden
chromatic wrote: On Tue, 2005-03-08 at 17:31 -0500, David Golden wrote: Yeah, it would be nice if we had a better way to handle this. Perhaps changing the idiom to: $Test->ok( $dressed_up, 'How nice do you look?' ) || $Test->reason( 'Refusing to wear a tie and jacket' ); and enc

Re: Test::Builder->create

2005-03-08 Thread chromatic
On Tue, 2005-03-08 at 17:31 -0500, David Golden wrote: > Let me say it a different way. Right now, Test::Builder and > Test::Harness (et al.) are tightly coupled. It would be nice to break > or at least reduce that coupling. Stuff deep in Test::Builder assumes > that the output is TAP. For

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 05:31:27PM -0500, David Golden wrote: > It would be nice if there were better symmetry so that something > like is() could stick its "got X, expected Y" message in "reason" field > of the details array if it fails. That's a good idea.

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 10:31:48PM +, Fergal Daly wrote: > > No, other way around. When a TB instance needs a TB::Counter it just says > > $tb->counter which, normally, returns a singleton but you can alter > > counter() > > so it returns something else. > > A singleton is a class that only

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 05:35:28PM -0500, David Golden wrote: > >This is too simplistic for Various Reasons that chromatic and I are still > >hashing out. > > Care to hash in public? What do you think this thread is about?

Re: Test::Builder->create

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 05:05:02PM -0500, David Golden wrote: > doing the what I want before I write it. I think the approach works, > but all this mucking about in the internals of Test::Builder feels like > voodoo. All the vodoo has already been done for Test::Tester. my @results = run_tests

Re: Test::Builder->create

2005-03-08 Thread David Golden
Michael G Schwern wrote: On Tue, Mar 08, 2005 at 02:54:46PM -0500, David Golden wrote: Could we also consider moving away from singletons that are hard-wired to Test::Builder? By that I mean make Test::Builder a 'factory' that gives either a default, plain vanilla Test::Builder object or else

Re: Test::Builder->create

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 01:42:49PM -0800, Michael G Schwern wrote: > On Tue, Mar 08, 2005 at 09:36:24PM +, Fergal Daly wrote: > > Cool, so actually T::B::Counter and T::B::Run are not singletons and > > Test::Builder is. > > No, other way around. When a TB instance needs a TB::Counter it just

Re: Test::Builder->create

2005-03-08 Thread David Golden
chromatic wrote: On Tue, 2005-03-08 at 14:54 -0500, David Golden wrote: Also, in thinking through the reorg of Test::Builder, it would be great if the notion of "success" or "failure" could be isolated from any particular form of output. That would mean that someone could use Test::Builder::

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 05:05:02PM -0500, David Golden wrote: > The use case I've been pondering is to be able to better control the > granularity of my tests within a particular scripts. Stuff like > Test::Class and Test::Block gets closer but not quite to what I would > like. I'd like to be

Re: perl 6 cpan (was Test::Builder->create)

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 01:44:13PM -0800, Ofer Nave wrote: > How is CPAN going to support simultaneous development of perl 5 and 6 > versions of modules? Last I heard Perl 6 will have a completely separate directory from the Perl 5 stuff allowing them to shed any legacy even at the CPAN layout le

Re: Test::Builder->create

2005-03-08 Thread David Golden
Michael G Schwern wrote: On Tue, Mar 08, 2005 at 03:39:17PM -0500, Michael Graham wrote: Something that's been sitting in the Test::Builder repository for a while now is Test::Builder->create. Finally you can create a second Test::Builder instance. I haven't done much with it and I think $Leve

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 02:39:53PM -0600, Andy Lester wrote: > On Tue, Mar 08, 2005 at 12:36:30PM -0800, Michael G Schwern ([EMAIL > PROTECTED]) wrote: > > Sorry to contradict, but yes it does. All the test methods return if they > > passed or failed. That's how the "ok( open FILE, "foo" ) || di

perl 6 cpan (was Test::Builder->create)

2005-03-08 Thread Ofer Nave
chromatic wrote: I've been writing notes for Test::Builder for Perl 6, though. It's a little something like: How is CPAN going to support simultaneous development of perl 5 and 6 versions of modules? -ofer

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 03:39:17PM -0500, Michael Graham wrote: > > Something that's been sitting in the Test::Builder repository for a while > > now is Test::Builder->create. Finally you can create a second Test::Builder > > instance. I haven't done much with it and I think $Level is still globa

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 09:36:24PM +, Fergal Daly wrote: > Cool, so actually T::B::Counter and T::B::Run are not singletons and > Test::Builder is. No, other way around. When a TB instance needs a TB::Counter it just says $tb->counter which, normally, returns a singleton but you can alter co

Re: Test::Builder->create

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 12:50:29PM -0800, chromatic wrote: > On Tue, 2005-03-08 at 20:40 +, Fergal Daly wrote: > > > By singleton do you mean that there's only ever 1 Test::Builder::Counter and > > it's shared between all the Test::Builder objects? > > By default there's only one. You can cr

Re: Test::Builder->create

2005-03-08 Thread chromatic
On Tue, 2005-03-08 at 20:40 +, Fergal Daly wrote: > By singleton do you mean that there's only ever 1 Test::Builder::Counter and > it's shared between all the Test::Builder objects? By default there's only one. You can create others, if necessary. > One way to allow this is to have a single

Re: Test::Builder->create

2005-03-08 Thread Fergal Daly
By singleton do you mean that there's only ever 1 Test::Builder::Counter and it's shared between all the Test::Builder objects? That's necessary in order to maintain consitent numbering of tests but it doesn't allow for a second counter to be established to temporarily count subtests (for example w

Re: Test::Builder->create

2005-03-08 Thread Andy Lester
On Tue, Mar 08, 2005 at 12:36:30PM -0800, Michael G Schwern ([EMAIL PROTECTED]) wrote: > Sorry to contradict, but yes it does. All the test methods return if they > passed or failed. That's how the "ok( open FILE, "foo" ) || diag $!" > idiom works. Right, but not on the larger scale. The "okne

Re: Test::Builder->create

2005-03-08 Thread Michael Graham
> Something that's been sitting in the Test::Builder repository for a while > now is Test::Builder->create. Finally you can create a second Test::Builder > instance. I haven't done much with it and I think $Level is still global > across all instances (bug) but I figured folks would want to play

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 02:29:22PM -0600, Andy Lester wrote: > On Tue, Mar 08, 2005 at 12:21:35PM -0800, Michael G Schwern ([EMAIL > PROTECTED]) wrote: > > > Also, in thinking through the reorg of Test::Builder, it would be great > > > if the notion of "success" or "failure" could be isolated fro

Re: Test::Builder->create

2005-03-08 Thread Andy Lester
On Tue, Mar 08, 2005 at 12:21:35PM -0800, Michael G Schwern ([EMAIL PROTECTED]) wrote: > > Also, in thinking through the reorg of Test::Builder, it would be great > > if the notion of "success" or "failure" could be isolated from any > > particular form of output. That would mean that someone c

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 02:54:46PM -0500, David Golden wrote: > Could we also consider moving away from singletons that are hard-wired > to Test::Builder? By that I mean make Test::Builder a 'factory' that > gives either a default, plain vanilla Test::Builder object or else a > specific subclass

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 12:09:02PM -0800, chromatic wrote: > > > Test::Builder::TestResults - the parent class for all types of tests > > > (pass, fail, todo, skip). This may be too much detail here, but I like > > > the idea of these knowing how to format themselves for output. > > > > Dunno wha

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 07:59:04PM +, Fergal Daly wrote: > > Darcs runs on non-Unix. 2>&1 is not cross-platform. > > I ported something form linux to win not so long ago and it worked. Googling > for > > "2>&1" windows > > turns a few batch files that use it and also > > http://mailman.lyr

Re: Test::Builder->create

2005-03-08 Thread chromatic
On Tue, 2005-03-08 at 14:54 -0500, David Golden wrote: > Could we also consider moving away from singletons that are hard-wired > to Test::Builder? By that I mean make Test::Builder a 'factory' that > gives either a default, plain vanilla Test::Builder object or else a > specific subclass? E.g

Re: Test::Builder->create

2005-03-08 Thread chromatic
On Tue, 2005-03-08 at 11:40 -0800, Michael G Schwern wrote: > > Test::Builder::TestResults - the parent class for all types of tests > > (pass, fail, todo, skip). This may be too much detail here, but I like > > the idea of these knowing how to format themselves for output. > > Dunno what this i

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 10:14:01AM -0800, Michael G Schwern wrote: > On Tue, Mar 08, 2005 at 05:48:28PM +, Fergal Daly wrote: > > In the case of though darcs though, is Perl just testing the output of > > commands that have been systemed? If so they could just add 2>&1 to the > > command line a

Re: Test::Builder->create

2005-03-08 Thread David Golden
Having an instance is great. Could we also consider moving away from singletons that are hard-wired to Test::Builder? By that I mean make Test::Builder a 'factory' that gives either a default, plain vanilla Test::Builder object or else a specific subclass? E.g., use Test::Builder 'Test::Build

Re: Test::Builder->create

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 11:24:59AM -0800, chromatic wrote: > > chromatic, do you still have those notes? > > Hm, not anywhere close. I think they were on your laptop, the one you > took apart at the last TPC in San Diego. Then it may be gone as Apple ate my last hard drive. It possible I have a

Re: Test::Builder->create

2005-03-08 Thread chromatic
On Tue, 2005-03-08 at 10:25 -0800, Michael G Schwern wrote: > What's still missing is a way to swap out the Test::Builder singleton with > your own custom subclass instance. There's some complicated issues there > which chromatic and I talked over a couple years ago and then promptly did > nothin

ANNOUNCE: Shell::Command 0.01

2005-03-08 Thread Michael G Schwern
As threatened, Shell::Command 0.01 is on its way to CPAN. Meanwhile its available here: http://www.pobox.com/~schwern/src/Shell-Command-0.01.tar.gz and the repo here http://svn.schwern.org/svn/CPAN/Shell-Command/trunk/

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Mark Stosberg
On Tue, Mar 08, 2005 at 05:48:28PM +, Fergal Daly wrote: > > In the case of though darcs though, is Perl just testing the output of > commands that have been systemed? If so they could just add 2>&1 to the > command line and then ignore stderr, I thought that wouldn't be portable. Mark

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Mark Stosberg
On 2005-03-08, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Tue, Mar 08, 2005 at 05:27:34PM +, Fergal Daly wrote: >> On Tue, Mar 08, 2005 at 04:56:08PM +, Mark Stosberg wrote: >> > Hmm...maybe Test::Output just needs a new feature: >> > >> > # Because sometimes you don't care who sai

Re: testing darcs with Perl (was: Re: testing non-modules)

2005-03-08 Thread Mark Stosberg
On 2005-03-08, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Tue, Mar 08, 2005 at 11:33:30AM -0500, Mark Stosberg wrote: >> > I'd make life simpler and dump the shell scripts, see the note about >> > cross-platform compatibility below. >> >> The philosophy behind allowing both is to have a low

Test::Builder->create

2005-03-08 Thread Michael G Schwern
Something that's been sitting in the Test::Builder repository for a while now is Test::Builder->create. Finally you can create a second Test::Builder instance. I haven't done much with it and I think $Level is still global across all instances (bug) but I figured folks would want to play with it

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 05:48:28PM +, Fergal Daly wrote: > In the case of though darcs though, is Perl just testing the output of > commands that have been systemed? If so they could just add 2>&1 to the > command line and then ignore stderr, Darcs runs on non-Unix. 2>&1 is not cross-platform

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 09:34:17AM -0800, Michael G Schwern wrote: > There's no equivalent to this? > > my $output = `some_program 2>&1`; > > Where STDOUT and STDERR are combined into one stream, keeping the order > correct. If there is it's not in the docs. They show things like output_l

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 05:27:34PM +, Fergal Daly wrote: > On Tue, Mar 08, 2005 at 04:56:08PM +, Mark Stosberg wrote: > > Hmm...maybe Test::Output just needs a new feature: > > > > # Because sometimes you don't care who said it. > > stdout_or_stderr_is() > > Test::Output allows > > my

Re: testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Fergal Daly
On Tue, Mar 08, 2005 at 04:56:08PM +, Mark Stosberg wrote: > Hmm...maybe Test::Output just needs a new feature: > > # Because sometimes you don't care who said it. > stdout_or_stderr_is() Test::Output allows my ($stdout, $stderr) = output_from {...}; then you can do your own tests, other

Re: testing darcs with Perl (was: Re: testing non-modules)

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 11:33:30AM -0500, Mark Stosberg wrote: > > I'd make life simpler and dump the shell scripts, see the note about > > cross-platform compatibility below. > > The philosophy behind allowing both is to have a low barrier to entry > for people submitting tests. Better to have te

testing STDOUT and STDERR at the same time with Test::Output

2005-03-08 Thread Mark Stosberg
On 2005-03-08, Michael G Schwern <[EMAIL PROTECTED]> wrote: > > PS I took a look at one of the Perl tests (pull.pl) and its needlessly > Unix-centric making lots of shell calls which can easily be done with > Perl, particularly rm -rf and mkdir -p (File::Path). Best to make it > cross-platform as

Re: testing darcs with Perl (was: Re: testing non-modules)

2005-03-08 Thread Mark Stosberg
On Tue, Mar 08, 2005 at 08:23:31AM -0800, Michael G Schwern wrote: > > perl -MTest::Harness -e 'runtests @ARGV' tests/*.pl Aha. Thanks. > Why would you distribute a private copy of Test::Harness? To use 'prove', which your example above illustrates I don't need. > Or do you mean you

Re: testing darcs with Perl (was: Re: testing non-modules)

2005-03-08 Thread Michael G Schwern
On Tue, Mar 08, 2005 at 03:31:37PM +, Mark Stosberg wrote: > Right now the tests are run one at a time, losing the benefit > of the summary report. > > I got stuck trying to think of how to best make this work. > > I don't think I want to use 'Makefile.PL', because the project already > has

testing darcs with Perl (was: Re: testing non-modules)

2005-03-08 Thread Mark Stosberg
I have a fork of the 'testing non-modules' question. :) I help maintain some Perl test scripts for darcs [1]. 1. http://www.darcs.net/ Right now the tests are run one at a time, losing the benefit of the summary report. I got stuck trying to think of how to best make this work. I don't thin

Re: Test::WWW::Mechanize 1.04

2005-03-08 Thread Andy Lester
On Tue, Mar 08, 2005 at 03:25:45PM +, Mark Stosberg ([EMAIL PROTECTED]) wrote: > Perhaps you mean this: > > $mech->get_ok( $url, 'Fetched home page' ); Yes, that's what I meant. My mistake. xoa -- Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance

Re: Test::WWW::Mechanize 1.04

2005-03-08 Thread Mark Stosberg
On 2005-03-04, Andy Lester <[EMAIL PROTECTED]> wrote: > I've updated Test::WWW::Mechanize to add get_ok() and follow_link_ok() > methods. If you've been writing > > $mech->get( $url ); > ok( $mech->success, 'Fetched home page' ); > > you can now do that as > > $mech->get_ok( $mech->success,