[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

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

2003-02-28 Thread schwern
On Thu, Feb 27, 2003 at 09:21:09PM +, Fergal Daly wrote: I am already not yet convinced. In particular, it makes this sort of test more difficult than it needs be: is_deeply($obj, { foo = 42, bar = 23 }); Absolutely, but there is currently no way to do this is_deeply($obj

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

2003-02-28 Thread schwern
On Thu, Feb 27, 2003 at 10:03:50PM +, Fergal Daly wrote: - let _deep_check take it's cue from the second argument. If the second argument is blessed then be strict about the classes, if it's unblessed then ignore the classes. This should happen at all levels in the structures.

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

2003-02-28 Thread Adrian Howard
I'd go for feature, not bug. For me is_deeply has always been for testing structure. We have isa_ok for checking class identity. Having one that tested for both might be useful, but I would not change the behaviour of is_deeply. Adrian On Thursday, February 27, 2003, at 05:32 pm, Fergal Daly

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

2003-02-28 Thread Adrian Howard
True. I usually expose deep objects by methods rather than hash access, so it's not really a problem for the majority of my code. Adrian On Friday, February 28, 2003, at 03:54 pm, [EMAIL PROTECTED] wrote: On Fri, Feb 28, 2003 at 11:51:07AM +, Adrian Howard wrote: Option three.

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' # $expected-[0

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

2003-02-27 Thread Fergal Daly
a bug. I am already not yet convinced. In particular, it makes this sort of test more difficult than it needs be: is_deeply($obj, { foo = 42, bar = 23 }); Absolutely, but there is currently no way to do this is_deeply($obj, bless({ foo = 42, bar = 23 }, MyClass)); and get a fail if $obj

Re: Removing CPAN's dependency on Test::More

2002-11-12 Thread Michael G Schwern
On Wed, Nov 13, 2002 at 11:32:21AM +1100, Ken Williams wrote: So why does CPAN.pm depend on Test::More anyway? It only uses it during its 'make test' phase, not during runtime operations. And when you can't install modules very easily because you don't have CPAN.pm working properly, it's

Re: callbacks at the end of Test::More ?

2002-11-07 Thread Nicholas Clark
tests have failed, and I can't see a clean way to do this. In an END block, grab the T::B object and check the summary(). #!/usr/bin/perl -w use Test::More tests = 1; pass('foo'); END { my $failed = grep!$_, Test::More-builder-summary; diag $failed ? Failed\n

Re: callbacks at the end of Test::More ?

2002-11-06 Thread Michael G Schwern
block, grab the T::B object and check the summary(). #!/usr/bin/perl -w use Test::More tests = 1; pass('foo'); END { my $failed = grep!$_, Test::More-builder-summary; diag $failed ? Failed\n : Passed\n; } The only trouble there is if the test as a whole fails during

Re: Test::More

2002-09-30 Thread H.Merijn Brand
On Sat 28 Sep 2002 03:25, Michael G Schwern [EMAIL PROTECTED] wrote: On Tue, Sep 24, 2002 at 05:57:41PM +0200, H.Merijn Brand wrote: 1. use_ok should have an entry in the manual for minimal version use_ok (Test::More, 0.47); This currently doesn't work quite right. Observe

Re: Test::More

2002-09-27 Thread Michael G Schwern
On Tue, Sep 24, 2002 at 05:57:41PM +0200, H.Merijn Brand wrote: 1. use_ok should have an entry in the manual for minimal version use_ok (Test::More, 0.47); This currently doesn't work quite right. Observe... $ perl -MTest::More -wle 'plan tests = 1; use_ok(Text::Soundex, 0.20)' 1..1

Test::More

2002-09-24 Thread H.Merijn Brand
1. use_ok should have an entry in the manual for minimal version use_ok (Test::More, 0.47); 2. I'm testing conversions to and from Unicode --8--- use Test::More tests = 86; use strict; BEGIN { use_ok (PROCURA::Diac, 4.12); SKIP: { $^V ge v5.8.0 or skip Need 5.8.0

Re: Test::More

2002-09-24 Thread Abe Timmerman
Op een mooie herfstdag (Tuesday 24 September 2002 17:57), schreef H.Merijn Brand: 2. I'm testing conversions to and from Unicode --8--- use Test::More tests = 86; use strict; BEGIN { use_ok (PROCURA::Diac, 4.12); SKIP: { $^V ge v5.8.0 or skip Need 5.8.0 for Unicode, 1

Re: Test::More::can_ok when using AutoLoader

2002-09-02 Thread Michael G Schwern
On Sat, Aug 31, 2002 at 02:05:53PM +0200, Elizabeth Mattijsen wrote: $ perl -Mblib -wle 'use AutoExample; print Yes if AutoExample-can(foo)' Using /home/schwern/tmp/AutoExample/blib Yes Hmmm... I'm doing BEGIN { use_ok( 'Thread::Pool' ) }... Maybe there is a difference there... Hmmm.

Re: Test::More::can_ok when using AutoLoader

2002-08-31 Thread Elizabeth Mattijsen
At 02:38 PM 8/30/02 -0700, Michael G Schwern wrote: On Fri, Aug 30, 2002 at 04:01:11PM +0200, Elizabeth Mattijsen wrote: Is there an easy way to check methods, whose loading is deferred with AutoLoader, with the can_ok() check? Nope. You have to create stubs. The AutoLoader module should do

Test::More::can_ok when using AutoLoader

2002-08-30 Thread Elizabeth Mattijsen
Is there an easy way to check methods, whose loading is deferred with AutoLoader, with the can_ok() check? Or would some magic need to be added to AutoLoader.pm? Currently, you get an error that the subroutines do not exist. Liz

[PATCH Test::More] Allow isa_ok( $classname, $parent )

2002-06-30 Thread chromatic
UNIVERSAL::isa because we want to honor isa() overrides diff -ur Test-Simple-0.45.old/t/More.t Test-Simple-0.45/t/More.t --- Test-Simple-0.45.old/t/More.t Sat Apr 20 17:34:40 2002 +++ Test-Simple-0.45/t/More.t Sun Jun 30 17:02:46 2002 -7,7 +7,7 } } -use Test::More tests = 41; +use Test

Re: [PATCH] Make Test::More::can_ok() use objects, not just classes

2002-04-20 Thread Michael G Schwern
On Sat, Apr 20, 2002 at 11:51:30AM -0700, chromatic wrote: Attached is a patch to make Test::More do the right thing (as I see it) in this case. Previously, it called can() on the class name, which obviously doesn't work here. You're right. I suspect something similar should be done

Re: Test::Builder and Test::More change requests

2002-04-04 Thread Michael G Schwern
is called) Sensible. Done. If anyone asks, it's your fault. Secondly, I was wondering about eq_set in Test::More. ok(eq_set([1,1,1],[1])); fails, where really it should work as sets don't care about reoccurring elements. Should this be 'eq_bag' instead? eq_set() is really just because

Re: Test::More::diag()

2001-12-10 Thread Michael G Schwern
On Mon, Dec 10, 2001 at 11:19:21PM +, Adrian Howard wrote: I'm planning on using diag(). ok( $foo == $bar ) || diag 'blah blah'; it has nice mnemonics with: open(FOO, bar) || die 'blah blah'; ok or diag open or die Thoughts? Little to short for my tastes my

Re: testing web foo with Test::More

2001-10-09 Thread Shane Landrum
web gadget: use strict; use Test::More qw(no_plan); use LWP::Simple; my $WEB_SYSTEM = 'foo.bar.com'; my $USERNAME = 'foo'; my $PASSWORD = 'bar'; use LWP::UserAgent; # We make our own specialization of LWP::UserAgent that asks for # user

testing web foo with Test::More

2001-10-07 Thread Kirrily 'Skud' Robert
OK, I've been putting off figuring this out for ages, but here it is: #!/usr/bin/perl -w use strict; use Inline 'WebChat'; use Test::More 'no_plan'; ok(google(), Can get google); __END__ __WebChat__ sub google { GET http

Test::More and WWW::Chat fighting over fail()

2001-10-07 Thread Kirrily 'Skud' Robert
Both Test::More and WWW::Chat export a routine called fail(). This makes it rather hard to write tests for web stuff using both these modules. Since WWW::Chat's fail() is only used internally, could I possibly request that it be changed to not export, and/or rename it _fail, or whatever

Re: [PATCH] Test::More isa_ok function

2001-09-28 Thread Andrew Wilson
On Mon, Sep 24, 2001 at 08:40:15PM -0400, Michael G Schwern wrote: On Mon, Sep 24, 2001 at 06:23:58PM -0500, Dave Rolsky wrote: The patch below allows you to supply your own test name for the isa_ok function (I find the default insufficiently descriptive). I'd like to do the same for

Re: [PATCH] Test::More isa_ok function

2001-09-28 Thread Michael G Schwern
On Fri, Sep 28, 2001 at 05:22:16PM +0100, Andrew Wilson wrote: I've just written a small logging module and I want ot do this isa_ok($lj, BlackStar::LumberJack, I'm a LumberJack and I'm ok); This feature is essential ;-) Reimplementing the chop() function? -- Michael G. Schwern

Re: [PATCH] Test::More isa_ok function

2001-09-25 Thread chromatic
In article [EMAIL PROTECTED], Dave Rolsky [EMAIL PROTECTED] wrote: On Tue, 25 Sep 2001, Michael G Schwern wrote: A, ok. How about this: my $yarrow = Bar-new; isa_ok($yarrow, Bar, 'yarrow'); isa_ok($foo, 'Alzabo::Foo', 'Return value from $bar-foreign_keys should be

Re: [PATCH] Test::More isa_ok function

2001-09-24 Thread Dave Rolsky
On Mon, 24 Sep 2001, Michael G Schwern wrote: On Mon, Sep 24, 2001 at 06:23:58PM -0500, Dave Rolsky wrote: The patch below allows you to supply your own test name for the isa_ok function (I find the default insufficiently descriptive). I'd like to do the same for can_ok but I don't think

Re: [PATCH] More Test::More stuff

2001-09-24 Thread Dave Rolsky
On Mon, 24 Sep 2001, Michael G Schwern wrote: On Mon, Sep 24, 2001 at 06:42:55PM -0500, Dave Rolsky wrote: +sub eval_ok ($) { +my ($code, $name) = @_; + +eval { $code-() }; +if ($@) { + ok( 0, $name - $@ ); +} else { + ok( 1, $name ); +} +} The

Re: [PATCH] More Test::More stuff

2001-09-24 Thread Kirrily Robert
In perl.qa, you wrote: eval { ...code... }; is( $@, '' ); Yeah, except that doesn't print out $@ in case of failure. If I'm checking that no exception occurs I want to know what the exception is when it happens. But it does! It says something like: not ok 23 # Failed test 1

[PATCH] Test::More isa_ok function

2001-09-24 Thread Dave Rolsky
+++ More.t Mon Sep 24 18:24:15 2001 @@ -1,4 +1,4 @@ -use Test::More tests = 22; +use Test::More tests = 23; use_ok('Text::Soundex'); require_ok('Test::More'); @@ -20,6 +20,7 @@ can_ok pass fail eq_array eq_hash eq_set)); isa_ok(bless([], Foo), Foo); +isa_ok

Re: What in t/op can use Test::More and what can't.

2001-09-03 Thread Michael G Schwern
On Mon, Sep 03, 2001 at 05:30:21PM +0100, Nicholas Clark wrote: t/op/numconvert.t Yes (I don't understand the warning at the top) Which warning would that be? Would you believe # Repent for the end is near? I have no idea what I was talking about. I think it's more likely to be

[PATCH] Test::More PREREQ_PM problem

2001-08-14 Thread Tatsuhiko Miyagawa
When writing tests using Test::More, we should put some phrase like this in Makefile.PL: WriteMakefile( 'NAME'= 'Foobar', 'VERSION_FROM' = 'Foobar.pm', # finds $VERSION 'PREREQ_PM' = { 'Test::More' = 0.08, }, ); This will lead to the following error