Re: Test::Builder2::Tester, first cut

2011-01-29 Thread fergal
est::Builder... as > soon as I patch up Test::Builder to not be quite so in bed with the > TAP formatter.  It's the next thing on my plate. Great, F > On Jan 25, 10:48 pm, Fergal Daly wrote: > > > > > > > > > Test::Tester has been doing exactly this for ye

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 21:35, [EMAIL PROTECTED] wrote: > On Thu, Feb 27, 2003 at 09:21:09PM +0000, Fergal Daly wrote: > > Or even better, cmp_objects(). Yep, sounds better. > > - let _deep_check take it's cue from the second argument. If the second > > argument

Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 16:40, [EMAIL PROTECTED] wrote: > > is_deeply() ignores the classes of blessed refs. So > > > > perl -MTest::More=no_plan -e 'is_deeply(bless([], "a"), bless([], "b"))' > > > > passes, > > Oh. Not sure if that's a bug or a feature. Discuss it on perl-qa. I think that

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 22:03, Fergal Daly wrote: > Would it be acceptable to add a third argument to _deep_check to switch > on/off bless checking, rather than having to reimplement the whole thing? Below is a very simple patch to do that. That makes cmp_object very easy F -- Do yo

Test::Set

2003-02-27 Thread Fergal Daly
f $this and $that are equal as sets and false otherwise. =cut sub eq_math_set { my ($this, $that) = @_; my ($extra, $missing) = _diff_bagset($this, $that, 1); (@$extra or @$missing) ? 0 : 1; } =item B eq_bag([EMAIL PROTECTED], [EMAIL PROTECTED]); This performs the same test as is_bag b

Test::More diagostics problem

2003-02-27 Thread Fergal Daly
There's a line missing from Test::More::_deep_check(). It results in funny diagnostics after comparing scalar refs, so perl -MTest::More=no_plan -e 'is_deeply([(\"a") x 5, "b"], [(\"a") x 5, "c"])' gives # Structures begin differing at: # $got->[0][1][2][3][4][5] = 'b' # $exp

Re: Test::More::is_deeply problems with blessings and stringified refs

2003-02-27 Thread Fergal Daly
On Thursday 27 February 2003 20:54, [EMAIL PROTECTED] wrote: > On Thu, Feb 27, 2003 at 05:32:42PM +0000, Fergal Daly wrote: > > I think that although a test that ignores blessed classes could be handy > > in some circumstances (ie programming in general), I reckon in the > > c

Re: Test::Set

2003-02-28 Thread Fergal Daly
On Friday 28 February 2003 12:23, Adrian Howard wrote: > Comments: > > - I'd prefer is_set rather than is_math_set So would I but eq_set is already taken by Test::More and I want to name the is_ and the eq_ functions conistently > - I'd like shallow comparison options as well as deep one

[PATCH] circular data structures in Test::More

2003-03-03 Thread Fergal Daly
This patch lets Test::More compare circular data structures. Get the latest version (0.47) of Test::More, apply fixes.patch to fix some issues, then apply circular.patch. Test with circular.t, F -- Do you need someone with lots of Unix sysadmin and/or lots of OO software development experienc

One more Test::More problem

2003-02-27 Thread Fergal Daly
Final one tonight! eq_array and eq_hash don't tidy up after themselves. You would have to be very unfortunate to be stung by this problem but potentially you could end up with extra references to some of your variables which could effect tests further on due to DESTROYs not being called or what

Meta testing

2003-03-02 Thread Fergal Daly
I'm writing test a test module and naturally I want to test it. 2 minutes ago I discovered Test::Builder::Tester but before finding that I spent several hours inventing a slightly different wheel... twice. The result is Test::Tester http://www.fergaldaly.com/computer/Test-Tester/ It's not com

Problem with Test::More and Does Not Exist

2003-03-03 Thread Fergal Daly
perl -MTest::More=no_plan -e 'is_deeply({}, {key => []})' should fail but doesn't because $DNE is deeply equal to [] and _deep_check doesn't notice the class difference. Patch attached. F -- Do you need someone with lots of Unix sysadmin and/or lots of OO software development experience? Go

Test::Deep 0.02

2003-03-19 Thread Fergal Daly
Hi, I've just uploaded Test::Deep 0.02 to CPAN. This module is a very souped up version of the is_deeply() test from Test::More. If you don't include an special comparison instructions, it behaves exactly like is_deeply() except it handles circular data structures and it compares the cla

Re: Test::Deep namespace

2003-06-19 Thread Fergal Daly
On Thursday 19 June 2003 15:24, Andy Lester wrote: > It would be nice if the functions ended in _ok, so it's clear that > they are actually outputting and not just returning booleans. There is only 1 function really, all the rest are shortcuts to the constructors of various plugins. I suppose I

[ANNOUNCE] Test::Warn::None 0.02

2003-06-23 Thread Fergal Daly
led. PITFALLS When counting your tests for the plan, don't forget to include the test that runs automatically when your script ends. BUGS None that I know of. SEE ALSO Test::More, Test::Warn AUTHOR Written by Fergal Daly <[EMAIL PROTECTED]>. COPYRIGHT Copy

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 11:37, Tels wrote: > Actually, I can see that Test::Warn::None could make the no_warnings() line > obsolete by calling this automatically in an END block. So: It IS obsolete. I DOES call it from an END block ;-) F

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 11:22, Michael G Schwern wrote: > > >> use Test::More::None; > > Typo? Yeso. > > > > Can't nowarings() call Test::More::plan_add(1) or something like this? > > > > Consider the following. > > use Test::More; > use Test::Warn::None; > plan tests => 42; > >

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 12:04, Tels wrote: > > It IS obsolete. I DOES call it from an END block ;-) > > Uh - *hides in a corner for the rest of the day* It happens to the best of us. I've updated the docs to make this more clear. Also how about calling it Test::Warn::Auto? I'm not particularly

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 12:36, Rafael Garcia-Suarez wrote: > +1 for ::Auto. > > BTW, what about modules that define their own category of warnings > (via warnings::register) ? It'd be useful to have a module to ease > testing for warnings presence/absence on certain conditions. > (Avoiding to span

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 19:56, Michael G Schwern wrote: > I don't quite understsand what "spanning perl interpreters" means. Neither did I until just now. I think it's the fact that forks will cause the END to run multiple times. It would be nice if Test::Builder gave a method to give us access

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 20:04, Andy Lester wrote: > All this "make sure no warnings fired" is good thinking. But why not > roll it into Test::Harness, and make it switch selectable? It's > really T::H that we want keeping an eye on this, right? Possibly... ...except how does Test::Harness know

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 19:55, Michael G Schwern wrote: > I like Test::Warn::None or some variation on it. Or even Test::NoWarnings. > Doesn't have to sit in the Test::Warn namespace. Test::NoWarnings sounds good to me. What is the correct etiquette for abandoning a namespace? Just delete the fi

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-24 Thread Fergal Daly
On Tuesday 24 June 2003 20:31, Michael G Schwern wrote: > If you want to do it to a whole test suite, PERL5OPT=-MTest::Warn::None comes > to mind. That's cool, I never saw that before. It's also a pretty convincing argument for an "I'm going to add an extra test" method in Test::Builder, F

blocks and subplans again

2003-06-25 Thread Fergal Daly
I just wanted to bring up nested blocks and sub-plans again. I've been hacking around in Test::Builder and I've implemented something that works and does something that I think is useful. It allows you to write tests that have output like 1..5 ok 1 - pass ok 2 - fail 1..3 a nested set of test

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-25 Thread Fergal Daly
On Wednesday 25 June 2003 17:49, Adrian Howard wrote: > The thread from the start of May about having optional / extendable > plans supported by Test::Harness would seem to be a good match for this > feature. > > http://archive.develooper.com/[EMAIL PROTECTED]/msg01883.html (Plan is > YAG

Re: blocks and subplans again

2003-06-25 Thread Fergal Daly
On Wednesday 25 June 2003 17:56, Andy Lester wrote: > This is something Schwern and I have discussed before, and that I > would LOVE to put into Test::Harness, if only we could hash out the > specifics. Are you ever in AIM/IRC? I'd kinda like to have an > online workgroup to thrash on the spec

Renaming modules (was Re: [ANNOUNCE] Test::Warn::None 0.02)

2003-06-28 Thread Fergal Daly
On Saturday 28 June 2003 02:51, Michael G Schwern wrote: > When I merged Test::Simple with Test::More I left a Test-More tarball lying > around containing a Makefile.PL which simply died saying "download > Test-Simple instead". That's OK for a merge (or you could have an empty archive with a depen

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-06-30 Thread Fergal Daly
On Wednesday 25 June 2003 20:15, Adrian Howard wrote: > Add an explicit "test script finished" footer? But how does the footer-adder know that the correct number of tests ran. You would need to declare a plan to run x additional extensions at which point you're doing sub-plans. I suppose I'm th

[ANNOUNCE] Test::NoWarnings 0.01

2003-06-30 Thread Fergal Daly
Hi all, I've settled on Test::NoWarnings as the right name for this. This improves on Test::Warn 0.02 by - not running the test in forked children - capturing the warnings as objects which is to say that for most people, it's exactly the same. F

Re: [ANNOUNCE] Test::Warn::None 0.02

2003-07-03 Thread Fergal Daly
On Wednesday 02 July 2003 00:25, Adrian Howard wrote: > On Monday, June 30, 2003, at 02:07 pm, Fergal Daly wrote: > The footer doesn't indicates that the correct number of tests ran > (that's the plan's job), it just shows that a test script completed > without er

Tests in END blocks and VERSION

2003-07-06 Thread Fergal Daly
Just hit this snag with Test::NoWarnings. When you include it in a Makefile.PL as a dependency you get [EMAIL PROTECTED]:> perl Makefile.PL Writing Makefile for Test::Deep You tried to run a test without a plan! Gotta have a plan. at /usr/lib/perl5/5.8.0/Test/NoWarnings.pm line 99 END failed--c

passing arguments to tests

2003-07-13 Thread Fergal Daly
Hi, is it possible with Test::Harness and MakeMaker to pass arguments to my test scripts? I think it's not but I just want to check for sure. The module I'm working on is getting a new "optimised" mode so I'd like to be able to run all the tests twice, once with and once without the opti

Re: passing arguments to tests

2003-07-13 Thread Fergal Daly
On Sunday 13 July 2003 15:53, Paul Johnson wrote: > The way I deal with this is to make a module that does all the heavy > lifting, give it an appropriate import sub, and then a test reduces to > something like: > > use TestX ( opt1 => "x", opt2 => "y" ) > > That covers everything except the pe

Re: blocks and subplans again

2003-08-20 Thread Fergal Daly
On Wednesday 20 August 2003 11:52, Michael G Schwern wrote: > I've yet to see a real use-case for plans of plans. Currently it's impossible to use testing functions and plans without major headaches. If I do this sub is_valid_person { my $person = shift; like($person->{Name}, "(

Re: blocks and subplans again

2003-08-20 Thread Fergal Daly
On Wednesday 20 August 2003 08:23, Michael G Schwern wrote: > You don't want subtests to have to know any state, such as how far to > indent. Why? Consider: Something has to keep state, I was assuming it would be the block. Anyway, the indentation thing is bad because it won't work for threaded

Re: blocks and subplans again

2003-08-21 Thread Fergal Daly
On Wednesday 20 August 2003 22:14, Michael G Schwern wrote: > 1..2 > ok 1 > 1..3 > ok 1 > ok 2 > ok 3 > 3..1 > ok 2 1 problem here is that you have not indicated anywhere how many times you will be extending the plan so maybe there's a 1..9 ok 1 ... ok 9 missing off the end, there's no way to

Re: blocks and subplans again

2003-08-21 Thread Fergal Daly
On Wednesday 20 August 2003 22:19, Michael G Schwern wrote: > That's subtests having overall test state. Ideally don't want the subtests > to have *any* awareness that they're being run as a subtest. The state is held in the Test::Builder object just as currently, it's just that that object has

Re: blocks and subplans again

2003-08-21 Thread Fergal Daly
ok 1.2.3 allows this ok 1.1.1 ok 1.2.1 ok 1.1.2 ok 1.2.2 so if people use the Test::AtRuntime they can also execute those tests at test time, just allocate subblock 1.* to all the runtime tests. They will appear in the output, intermixed with all your other tests but they will not interfere wi

Re: Phalanx has started, and I need perl-qa's help

2003-08-22 Thread Fergal Daly
On Friday 22 August 2003 15:08, Andy Lester wrote: > Core modules are phase two because of the Extra Excitement that will > be caused by mucking with them and pumpking coordination and whatnot. None of the phalanx 100 depend on any core modules? Or you just plan to deal with the bare minimum of c

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
The question needs changing. Both versions of is_deeply will give the same answer on these tests. I was going to say: What you need is package MyOtherString; use overload '""' => sub { shift->[0] }, fallback => 1; sub new { my ($class, $val) = @_; bless [ $val ], $class; } But actuall

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 15:29, Tony Bowden wrote: > On Tue, Sep 09, 2003 at 01:25:22PM +0100, Adrian Howard wrote: > > >1) ok $str1 eq $str2; > > >2) is $str1, $str2; > > >3) is_deeply [$str1], [$str2]; > > >4) is_deeply $str1, $str2; > > All should pass as far as I am concerned. I agree. The

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 19:27, Gordon Henriksen wrote: > Isn't the easiest way to get a recursive-and-exact object graph match to > simply use an existing serializer (FreezeThaw, Data::Dumper). This > leverages the circular reference handling and introspection smarts built > into those librari

Re: Test::More and 'deep' tests

2003-09-09 Thread Fergal Daly
On Tuesday 09 September 2003 19:23, Tels wrote: > I agree. For instance, ok() just looks at the outside, and if it compares ok, > the objects are considered equal. After all, this is the entire point behind > overloading and tie, to "fake" something. For instance, this "feature" of > ok() makes

Re: maint @ 21116

2003-09-09 Thread Fergal Daly
ignore-overloady as you tell it and it will do these things exactly where you tell it to do them and nowhere else. It does everything except make the .t http://www.esatclear.ie/~fergal/sounds/surp.wav :-) F

Re: Using environment variables to control long running tests (again)

2003-11-19 Thread Fergal Daly
On Wed, Nov 19, 2003 at 01:45:31PM +1100, Andrew Savige wrote: > I think the two environment variables can happily coexist as > shown in the table below: > > PERL_SMOKE PERL_SKIP_LONG_TESTS > Naive User0 0 > Contrary User 1

Re: whats the 'right way' to test for output on STDERR

2003-11-20 Thread Fergal Daly
It's so worthwhile that it's already there http://search.cpan.org/~bigj/Test-Warn/ F On Thu, Nov 20, 2003 at 02:27:48AM -0700, Jim Cromie wrote: > hi all, > > im patching a module that uses Test::More, and I want to include a test > to prove that a carp is being called when function args are wr

Re: tesing exceptions of Error.pm

2003-12-03 Thread Fergal Daly
On Tue, Dec 02, 2003 at 10:05:46PM -0800, Michael G Schwern wrote: > Why not? > > catch MyError with { > like( $ex, qr/Bad thing/ ); > }; If there is no exception then then that test won't execute. It'd have to be something like try { f(); fail("no excep

Re: Test::Benchmark ??

2003-12-04 Thread Fergal Daly
On Thursday 04 December 2003 21:51, Michael G Schwern wrote: > But it could be. It would be nice to have a test like "make sure the > hand optimized version is faster than the unoptimized version" or "make sure > the XS version is faster than the Perl version". Yeah - this would probably be usefu

Re: Test::Benchmark ??

2003-12-04 Thread Fergal Daly
On Thursday 04 December 2003 22:51, Michael G Schwern wrote: > Calibration would be pretty straight forward. Just have a handful of > loops to run known snippets of Perl and calibrate the pmip based on how long > they take to run. This would change from Perl version to Perl version > and platform

[ANNOUNCE] Test::Benchmark

2003-12-16 Thread Fergal Daly
Benchmark, Test::Builder but they come with most Perl's. HISTORY This came up on the perl-qa mailing list, no one else. SEE ALSO Test::Builder, Benchmark AUTHOR Written by Fergal Daly <[EMAIL PROTECTED]>. COPYRIGHT Copyright 2003 by Fergal Daly <[EMAIL PROTE

Re: [ANNOUNCE] Test::Benchmark

2003-12-17 Thread Fergal Daly
On Wed, Dec 17, 2003 at 09:28:48AM -0700, Jim Cromie wrote: > Hi Fergal, > > Id like to see a slightly different interface: > >is_faster( sub{}, sub{}, "1st is faster"); This would be nice but what value should I use for iterations? I suppose -1 would be safe en

[ANNOUNCE] Test::Benchmark 0.002

2003-12-20 Thread Fergal Daly
Main changes added is_fastest() comparison was broken (but not completely broken so it still passed the tests) available soon on CPAN and now on http://www.fergaldaly.com/computer/Test-Benchmark/ F

Re: Setting TODO by test number

2004-01-12 Thread Fergal Daly
You can just do Test::Builder->new to get the Test::Builder object. It will be the same one used by Test::More because it's a singleton. That way you should need no patches, F On Mon, Jan 12, 2004 at 05:26:59PM +0100, Elizabeth Mattijsen wrote: > I'm using Test::xxx as a tool for testing the func

Re: Test::More::todo_some ? (was: Re: Setting TODO by test number)

2004-01-13 Thread Fergal Daly
On Tue, Jan 13, 2004 at 04:35:21PM +0100, Elizabeth Mattijsen wrote: > At 16:47 + 1/12/04, Fergal Daly wrote: > >You can just do Test::Builder->new to get the Test::Builder object. It will > >be the same one used by Test::More because it's a singleton. That way you &g

Re: Test::More::todo_some ? (was: Re: Setting TODO by test number)

2004-01-13 Thread Fergal Daly
On Tuesday 13 January 2004 16:41, Elizabeth Mattijsen wrote: > Maybe the first parameter of "todo_some" should also accept a code > reference to a subroutine which, given the other parameters, is > supposed to give the TODO reason? That would make it even more > flexible, I would think. I thin

Re: ok(1,1) vs. ok ('foo','foo') in Test::More

2004-02-03 Thread Fergal Daly
On Tuesday 03 February 2004 20:46, Tels wrote: > PS: Thanx for your suggestion, but what exactly does this do: > > sub ok > { > @_ = 1; > goto &Test::More::ok; > } > > Pass a single (1), or only the first argument? *puzzled* It passes a single (1) :-( It should be $#_ = 0; I go

Re: ok(1,1) vs. ok ('foo','foo') in Test::More

2004-02-03 Thread Fergal Daly
> If I could just change "Test;" to "Test::More;" without hundreds of warnings > springing on me I know I would convert the test scripts and then change > them step by step over to the new code (or not change them at all, because > don't change working code..) If you don't mind adding a use My

Re: testing for unsuccessful require - mocking require ?

2004-06-19 Thread Fergal Daly
Below is Hide.pm, you can use it like this use Hide qw( Foo ); require Bar; # will be fine require Foo; # will fail I just wrote it now. It seems to work (even if @INC already contains subrefs, arrayrefs or objects). You can even use it twice and everything should just work. It seems to have a p

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-25 Thread Fergal Daly
On Fri, Jun 25, 2004 at 04:05:09PM +0100, Adrian Howard wrote: > > On 24 Jun 2004, at 20:19, Andrew Pimlott wrote: > > >On Thu, Jun 24, 2004 at 05:08:44PM +0100, Adrian Howard wrote: > >>Where xUnit wins for me are in the normal places where OO is useful > >>(abstraction, reuse, revealing intenti

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-26 Thread Fergal Daly
On Fri, Jun 25, 2004 at 10:13:52PM +0100, Adrian Howard wrote: > On 25 Jun 2004, at 16:51, Fergal Daly wrote: > [snip] > >NB: I haven't used xUnit style testing so I could be completely off > >the mark > >but some (not all) of these benefits seem to be available i

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-26 Thread Fergal Daly
On Fri, Jun 25, 2004 at 02:18:49PM -0500, Andy Lester wrote: > On Fri, Jun 25, 2004 at 04:51:29PM +0100, Fergal Daly ([EMAIL PROTECTED]) wrote: > > > * I never have to type repetitive tests like > > > > > > isa_ok Foo->new(), 'Foo' > > > &

Re: Test::More::is_deeply() bug

2004-06-30 Thread Fergal Daly
There are patches in the archives for this and a couple of other bugs but they were submitted along with another change that wasn't acceptable so they were never applied. A search for is_deeply should find the patches and a long argument, F On Wed, Jun 30, 2004 at 09:12:45AM -0400, Geoffrey Young

Re: Test::More::is_deeply() bug

2004-06-30 Thread Fergal Daly
On Wed, Jun 30, 2004 at 09:59:15AM -0400, Geoffrey Young wrote: > I found some stuff about is_deeply() and stringified references, but it > doesn't look to me to be the same thing. the problem I am describing is the > difference specifically between an empty string and undef. > > is_deeply(['']

Re: Test::More::is_deeply() bug

2004-07-08 Thread Fergal Daly
On Thu, Jul 08, 2004 at 03:22:57PM -0400, Michael G Schwern wrote: > What version of Test::More is that? Not the one it should have been! I had patched my version in work long ago and forgot about it. Oddly, someone else posted a patch against the original for the same thing on p5p the next day,

Re: [IDEA] Drop into the debugger on failure

2004-07-08 Thread Fergal Daly
On Thu, Jul 08, 2004 at 01:59:35PM -0400, Michael G Schwern wrote: > Likely you'd control if you wanted this behavior with > HARNESS_PERL_SWITCHES=-MTest::AutoDebug > > This can be implemented, currently, by adding a post hook onto > Test::Builder->ok() with Hook::LexWrap or Sub::Uplevel. I'm c

Re: [IDEA] Drop into the debugger on failure

2004-07-08 Thread Fergal Daly
On Thu, Jul 08, 2004 at 04:37:06PM -0400, Michael G Schwern wrote: > With inheritence, only one variant can be used at a time. > > With event subscribers, lots of variants can be used at a time. > > Consider what happens when you want to use Test::AutoDebug and a hypothetical > module which color

Re: [IDEA] Drop into the debugger on failure

2004-07-09 Thread Fergal Daly
On Thu, Jul 08, 2004 at 08:40:54PM -0400, Michael G Schwern wrote: > On Thu, Jul 08, 2004 at 11:53:52PM +0100, Fergal Daly wrote: > > The main point was that the OO way works right now, > > So does event hooks. Hooks are things you can hang stuff off of, but > they're al

Re: [IDEA] Drop into the debugger on failure

2004-07-09 Thread Fergal Daly
On Fri, Jul 09, 2004 at 11:00:28AM -0400, Michael G Schwern wrote: > Never underestimate The Damian. For a moment I though I had. > #!/usr/bin/perl -w > > use Hook::LexWrap; > use Test::Builder; > use Term::ANSIColor; > > wrap *Test::Builder::diag, pre => sub { > $_[1] = color('red') . $_

[ANNOUNCE] Test::Tester 0.09

2004-07-12 Thread Fergal Daly
Test::Tester is a(nother) module to allow you to test your test modules, hopefully with the minimum of effort and maximum flexibility. With version 0.09, the final bit of interface awkwardness is gone and test scripts can now look like this use Test::Tester; # load me first use Test::MyNewModule

Re: [ANNOUNCE] Test::Simple 0.48_02

2004-07-19 Thread Fergal Daly
On Mon, Jul 19, 2004 at 04:25:35PM +0100, Adrian Howard wrote: > Which causes anything testing test diagnostic output with > Test::Builder::Tester to fall over. Test::Class, Test::Exception & > Test::Block's test suites now all fail. > > Pooh sticks. > > My temptation is to say the new behaviou

Re: is_deeply hangs

2005-01-23 Thread Fergal Daly
What version of Test::More? Only the most recent versions can handle circular data structures, so I'd guess you have a circular data structure and an older version, Fergal On Sun, Jan 23, 2005 at 09:22:19AM -0800, Ovid wrote: > (Aargh! This time I'll send this from the correct

Re: is_deeply hangs

2005-01-23 Thread Fergal Daly
ings; use Test::More 'no_plan'; my ($r, $s); $r = \$r; $s = \$s; is_deeply($s, $r); Fergal On Sun, Jan 23, 2005 at 07:13:13PM +, Fergal Daly wrote: > What version of Test::More? Only the most recent versions can handle > circular data structures, so I'd guess you have

Re: is_deeply hangs

2005-01-23 Thread Fergal Daly
d for cirularitinessness. Fergal On Sun, Jan 23, 2005 at 08:04:23PM +0000, Fergal Daly wrote: > Oops, actually the latest is_deeply doesn't correctly handle _all_ circular > structures. If the circle includes a hash or an array it will work but if it > only includes scalar references t

Re: eq_array testing values prematurely...

2005-02-07 Thread Fergal Daly
It seems to me that that would just hide other problems. This function is for comparing 2 arrays and if neither of them things passed in are actually arrays then it's quite right to issue a warning. Why is this test passing undef into both arguments of eq_array? Fergal On Tue, Feb 08, 20

[ANNOUNCE] Test-Tester-0.101

2005-02-16 Thread Fergal Daly
more consistent with Test::Builder's behaviour. Fergal

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread Fergal Daly
I was thinking of knocking together Test::AnnounceVersion. use Test::AnnounceVersion qw(A::List Of::Modules); which results in # using version 1.5 of A::List # using version 0.1 of Of::Modules supplying no import args would make it output $VERSION from every package it can find. If you don't w

Re: TAP docs

2005-02-21 Thread Fergal Daly
On Mon, Feb 21, 2005 at 08:31:43PM -0600, Andy Lester wrote: > >was expected. I propose to fix this by allowing, in place of a plan at > >the beginning, something like the line "ends with plan". > > In effect, finding > > ok 1 > > as the first line means "ends with plan". I think that's

Re: How can I suspend/control a Test::Builder testing session?

2005-02-26 Thread Fergal Daly
Look at Test::Tester, it hijacks the Test::Builder object and replaces with another that sometimes delegates to the real Test::Builder object and other times delegates to a custom Test::Builder object that just collects results without outputting anything or affecting the "real" test results. You

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 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 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 +0000, 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 t

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 Fergal Daly
On Tue, Mar 08, 2005 at 12:50:29PM -0800, chromatic wrote: > On Tue, 2005-03-08 at 20:40 +0000, 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

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 +0000, 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 n

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 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-10 Thread Fergal Daly
On Tue, Mar 08, 2005 at 10:11:09PM -0500, Michael Graham wrote: > > > > 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

Re: TestSimple/More/Builder in JavaScript

2005-04-07 Thread Fergal Daly
Were you aware of JsUnit? http://www.edwardh.com/jsunit/ I prefer the Test::More style of testing most of the time. I count myself lucky I've never had to use a testing framework for javascript! F On Thu, Apr 07, 2005 at 11:23:59AM -0700, David Wheeler wrote: > Greetings fellow Perlers, > > I'

Re: verbose diagnostics

2005-04-28 Thread Fergal Daly
Where is TEST_VERBOSE documented? I see HARNESS_VERBOSE in http://search.cpan.org/~petdance/Test-Harness-2.48/lib/Test/Harness.pm F On 4/28/05, Adrian Howard <[EMAIL PROTECTED]> wrote: > > On 28 Apr 2005, at 14:23, Paul Johnson wrote: > > > Using Test::More, I would like to send some diagnosti

Re: is_deeply() and code refs

2005-06-26 Thread Fergal Daly
You have 3 situations 1 the refs came from \&somefunc 2 the refs come from evaling strings of code 3 the refs are closures and therefore have some data associated with them For 3, it looks like B::Deparse does't handle the data at all so even if the deparsed subs are identical they may behave tot

Re: is_deeply() and code refs

2005-06-27 Thread Fergal Daly
On 6/26/05, Michael G Schwern <[EMAIL PROTECTED]> wrote: > > For 3, it looks like B::Deparse does't handle the data at all so even > > if the deparsed subs are identical they may behave totally > > differently. > > This will simply have to be a caveat. Fortunately, if B::Deparse ever gets > this

Re: is_deeply() and code refs

2005-06-27 Thread Fergal Daly
On 6/27/05, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Mon, Jun 27, 2005 at 01:41:30AM +0100, Fergal Daly wrote: > > I'm not sure there is a right way to deparse closures (in general). > > For example if a variable is shared between 2 closures then it only > >

Re: is_deeply() and code refs

2005-06-28 Thread Fergal Daly
On 6/27/05, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Mon, Jun 27, 2005 at 11:20:07AM +0100, Fergal Daly wrote: > > > I'm perfectly happy to punt this problem over to B::Deparse and let them > > > figure it out. As it stands B::Deparse is the best we can

Re: is_deeply() and code refs

2005-06-28 Thread Fergal Daly
On 6/28/05, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Mon, Jun 27, 2005 at 11:34:58PM +0100, Fergal Daly wrote: > > Forgetting philosphical arguments about what's the right thing to do, > > I think the strongest point against this is that there may be people &g

Re: Fwd: [demerphq@gmail.com: Re: fixing is_deeply]

2005-07-01 Thread Fergal Daly
On 7/1/05, Michael G Schwern <[EMAIL PROTECTED]> wrote: > is_deeply() is not about exact equivalence. Its about making a best fit > function for the most common uses. I think most people expect [$a, $a] and > [$b,$c] to come out equal. > > Test::Deep is for tweaked deep comparisons. Test::Deep d

is_deeply and overloading

2005-07-01 Thread Fergal Daly
What's going on with overloading in 0.60? The docs say it will compare a string-overloaded object with a string but when I run the code below I get === # x = stringy not ok 1 # Failed test (over.pm at line 8) Operation `eq': no method found, left argument in overloaded package over

Re: Fwd: [EMAIL PROTECTED]: Re: fixing is_deeply]

2005-07-02 Thread Fergal Daly
ent people. my $p1 = Person->new(Name => "Fergal Daly", Age => 31); my $p2 = Person->new(Name => "Fergal Daly", Age => 31); They live in 2 houses but one of the owns both houses. my $h1 = House->new(Owner => $p1, Resident => $p1); my $h2 = House->

Re: Fwd: [EMAIL PROTECTED]: Re: fixing is_deeply]

2005-07-02 Thread Fergal Daly
On 7/2/05, Michael Peters <[EMAIL PROTECTED]> wrote: > But if we say >x=y and x=z can we then say that x,x != y,z > > If say >$x = []; >$y = []; >$z = []; >is_deeply($x, $y); # passes >is_deeply($x, $z): # passes >is_deeply([$x,$x], [$y, $z]); # fails for some reason >

Re: Fwd: [EMAIL PROTECTED]: Re: fixing is_deeply]

2005-07-02 Thread Fergal Daly
On 7/2/05, Michael Peters <[EMAIL PROTECTED]> wrote: > That's what I'm trying to point out. If we follow the reasoning fully > out then the second call to is_deeply() would need to fail as well as > the first. Try explaining that to the someone using it. > > calls to is_deeply() *need* to behave i

Re: Fwd: [EMAIL PROTECTED]: Re: fixing is_deeply]

2005-07-02 Thread Fergal Daly
On 7/2/05, Andrew Pimlott <[EMAIL PROTECTED]> wrote: > On Sat, Jul 02, 2005 at 08:55:34AM +0200, demerphq wrote: > > The entire basis of computer science is based around the idea that if > > you do the same operation to two items that are the same the end > > result is the same. > > Citing "comput

  1   2   3   >