On Mon, Mar 31, 2003 at 12:45:14PM +0100, Dominic Mitchell wrote:
> I've just uploaded a new module to CPAN[1], Test::XML. It contains a
> couple of functions for examining XML output of functions in a slightly
> saner way than is().
>
> http://search.cpan.org/author/SEMANTICO/Test-XML-0.03
e current process. This means
the tricks above will work.
It can be found here:
http://www.pobox.com/~schwern/tmp/esmith-TestUtils.pm
Adapt as you like.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]>
After shuffling some files around and doing some permissions tricks, the
Perl QA Wiki is working again! Everything is now editable.
http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Ass
use Test::More tests => 42;
use Test::Binary;
is(...);
binary_is(...);
See http://www.pobox.com/~schwern/talks/Writing_A_Test_Library/full_slides/
for details about using Test::Builder.
--
Michael G. Schwern <[EMAIL PROTECTED]&
Test::Foo::Inside;
sub wiffle {
something(@_);
}
...and in your test code...
use Test::Foo;
wiffle();
Ooops.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTE
r->create(state => $tb->state);
You're right, this one isn't necessary given the *state methods sketched out
above.
> >with those plus the push/pop_stack methods you can pick and choose what
> >sort
> >of state sharing you want.
>
> If we have explicit acce
- copies the state of one object to a new one
copy & share state- like copy, but test state is shared between the
original and the copy
with those plus the push/pop_stack methods you can pick and choose what sort
of state sharing you want.
--
Michael G. Schwe
sub real_test_func {
...
$TB->ok($test);
...
}
a practical example would be an Exporter/Exporter::Heavy poor-man's
autoloader setup.
Of course, there's nothing stopping you from overriding level() to be
magical, once I implement
;
> Or is this a sneaky way to get more people to install Test::More
> on their machines?
CPAN::MakeMaker?
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Ooops, fatal mutation in the test script.
der::Level + 1;
>
> return $self->SUPER::like(@_)
>}
Oh, to have real end-of-scope conditions.
> > > > The real reason why I put all the data into lexicals rather than a hash is
> > > > because its easier to type $Have_Plan than $self->{Have_Plan}.
&g
On Mon, Nov 11, 2002 at 02:51:00PM -0800, chromatic wrote:
> On Monday 11 November 2002 14:40, Michael G Schwern wrote:
>
> > > We *could* add a method called really_create_a_new_builder() that doesn't
> > > have the singleton properties, but what problem does that s
e object while leaving another in
a normal state to perform the tests.
The real reason why I put all the data into lexicals rather than a hash is
because its easier to type $Have_Plan than $self->{Have_Plan}.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schw
ing problems with tests
relying on object destruction.
- Added example of calculating the number of tests to Test::Tutorial
- Peter Scott made the ending logic not fire on child processes when
forking.
* Test::Builder is once again ithread safe.
--
Michael G. Schwe
convinced its a good
idea.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Home of da bomb
ecessary to load threads.pm
before Test::More or Test::Builder if you wish to use threads in your tests.
use threads;
use Test::More;
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]>
At YAPC::Europe there was some discussion about Test::Builder->level,
$Test::Builder::Level and the fact that they don't really work well as
implemented. I know we reached some sort of consensus about how to do it
better, but I've forgotten it.
Anyone remember?
--
Michael G. Schw
r an is_passing() method. Or both.
BTW How does one get the current srand if you use the one set by Perl?
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
I'm not actually Kevin Lenzo, but I play him on TV.
On Tue, Oct 15, 2002 at 10:34:26AM +0100, Nicholas Clark wrote:
> On Mon, Oct 14, 2002 at 09:00:42PM -0400, Michael G Schwern wrote:
> > 5.8.0's threads are giving me serious headaches. When 5.8.1 comes out I
> > might drop support for 5.8.0's threads just so I can rem
7;s threads just so I can remove a large volume
of work-around code.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
List context isn't dangerous. Misquoting Gibson is dangerous.
-- Ziggy
:Harness to be upgraded which has been
causing some problems lately. Something I'm moving to fix by making the
Test::Harness upgrade non-optional when you install Test::More. But that's
an implementation issue and will eventually fade away.
[1] This thinking makes me nervous, so I
ry::Heap;
my @array = (1..1);
HeapChange "creation of array";
my @dup = @array;
HeapChange "duplication of array";
A more broad Devel::Internals or a more user-friendly Devel::Memory can be
left for later, and the functionality of D
is a sign they like
> the overall picture. And my life is now better for realizing these two
> truths. :-)
We're Perl programmers. Praise is implicit, like everything else in the
language. :)
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl
gt; >
> > ?
>
> See another answer in this thread proposing to return a list of lists. I like
> that.
Seperate out the three different pieces of functionality, returning the
current memory state, printing a memory diagnostic and returning the memory
history, into three differen
ler's namespace. So you can have
your methods which print neatly formatted diagnostics seperate from your
methods which simply return values.
> Used in scalar context returns the current sbrk value
Shouldn't sbrk() do that? Is this the same value as MemUsed() would pr
oice was played by
Orson Wells in one of his last performances.
Anyhow, I know more about Unicron than Unicode.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Perl_croak(aTHX_ "Believe me, you don't want to use \"-u\" on a Macintosh");
-- toke.c
est::More;
# Failed test (-e at line 1)
# Tried to use 'Test::More'.
# Error: You tried to plan twice! Second plan at (eval 1) line 3
# Looks like you failed 1 tests of 1.
schwern@blackrider:~/src/devel/Test-Simple$
I'll have to put in some special case code to make
t variable Test::Harness responds
to.
Test::Class uses the TEST_VERBOSE environment variable to print out the name
of each test before it's run.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Tobacco time!
s find lib/
> >>'.' won't necessarily be in the path anyway.
> >
> >Sorry, I ment perl's @INC.
>
> That's what I meant too. People can build Perl without '.' in
> @INC, right?
I don't think so.
--
Michael G. Schwern &
an pages. It can produce HTML
and lots of other formats.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Still not king
Heck: with a smart enough TestInit, it could even adjust @ARGV
> so that you could specify all *.t paths in Unix format, if that
> would be helpful.
Hmmm. I can't think of a use.
> >and perhaps reduced a little further by moving/linking
> >TestInit.pm into the
> &g
tests are run using t/TEST (ie. "make test") are run with TestInit. So
strictly speaking the BEGIN block is redundant. t/harness (ie. "make
test_harness") is currently not using TestInit. There's currently a bug
where $Test::Harness::switches is not honored.
--
Mich
EGIN { use_ok( 'Thread::Pool' ) }... Maybe there is a
> difference there...
Hmmm. Shouldn't be a difference.
> Ok, so it _should_ work. I'll see if I can boil this down and create a
> bugreport if I can.
--
Michael G. Schwern <[EMAIL PROTECTED]>htt
5.6.1 /usr/local/lib/site_perl .) at
/usr/share/perl/5.6.1/AutoLoader.pm line 147.
at lib/AutoExample.pm line 5
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Mainline Heroin time!
On Fri, Aug 30, 2002 at 11:57:16AM +0100, Nick Ing-Simmons wrote:
> Michael G Schwern <[EMAIL PROTECTED]> writes:
> >On Fri, Aug 30, 2002 at 05:54:15PM +1000, Ken Williams wrote:
> >> Oh, one big lib/, not several different ones? So then why can't it be
> >>
XS?
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Do you have a map? Because I keep getting lost in your armpits.
hes back to the author.
Keeping them in sync with p5p's patches is the hardest part.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
There is a disurbing lack of PASTE ENEMA on the internet.
lace that elsewhere things get more complicated
when trying to run an individual test:
./perl -It -MTestInit lib/Foo/whatever.t
or
./perl -I. -MTestInit ../lib/Foo/whatever.t
What it boils down to is how to you remove the need for the cargo-cult BEGIN
block in each test while still maki
s are run. All non-XS modules
are never really "built", they're already in lib/. All XS modules are built
and their results put into lib/ and then the tests are run.
So, effectively, the core "installs" every modules into lib/ then runs all
their tests. This is so mo
sing a CPAN shell every module install is going to be a chore anyway.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
I blame myself. AND SATAN.
Then one could do something like this:
perl -Mblib=only t/foo.t
>Sorry if I've wasted your time by telling you something you
>already knew,
>or had inferred from Hugo's reply.
I might have inferred it, but this helped me understand various
implications, actually.
-Ke
On Mon, Aug 26, 2002 at 04:05:26PM -0400, John Peacock wrote:
> Specifically, in order to test that the locale stuff is working, I need to
> have two different locales installed to switch between. Currently, I am
> using en_US and en_GB, but obviously that ignores most of the planet.
>
> I was
not fire on child processes when
forking.
* Test::Builder is once again ithread safe.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
I do have a cause though. It
a prereq on
Test::Harness. The problem is the installation is almost always screwed up,
an old version of T::H winds up shadowing.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Airplane Glue sniffing time!
zabo via CPANPLUS. How about a way to _force_
> it to prompt or give up if that's really impossible?
A timeout argument to prompt() might be worthwhile. And an accompanying
environment variable.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
P
is the best place to handle this.
Test::Harness 2.03 is a prerequsite of Test::More.
Either it didn't get installed for some reason or your old version is
shadowing. T::H somewhere around 1.2x installed itself into site_perl, not
the core, so you might have a leftover. Try a "make in
ilder, so
> REFCNT doesn't come to 0 before global cleanup.
Whoa, nice catch! And thanks for catching the missing t/has_plan's in the
MANIFEST. :)
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]>
d.
+
+=back
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Tasty, yet morally ambiguous.
this is a request to place Inline::C into 5.9 to facilitate easy testing
of the C API.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
IMHO bugs in Perl 5 shouldn't carry over to
t, explaining how to do it, how perl5's tests are structured
> to reduce interdependencies, use Test::More; when Test::More is not
> appropriate.."
Porting/patching.pod
About the only thing that's missing is docs for t/test.pl.
--
Michael G. Schwern <[EMAIL PROTE
Figured folks might be interested in slides from talks at OSCON:
http://www.pobox.com/~schwern/talks/How_To_Be_Lazy_Redux/
http://www.pobox.com/~schwern/talks/Test_Tutorial/
http://www.pobox.com/~schwern/talks/Writing_A_Test_Library/
--
Michael G. Schwern <[EMAIL PROTECTED]>
here's a slide in the
Test::Tutorial talk with a list current as of a month ago.
o If you don't already have them installed, you only need to do it once.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTE
On Sat, Jul 27, 2002 at 09:44:03AM -0700, chromatic wrote:
> This patch captures messages sent through diag() and stores them in the
> diagnostic array. Now all of the information the tests generate is available
> for later inspection.
Dude, where's my patch?
--
Michael G. Sch
On Sat, Jul 06, 2002 at 06:57:27PM -0700, chromatic wrote:
> My test was:
>
> use_ok( 'Child::Class' );
> isa_ok( 'Child::Class', 'Parent::Class' );
>
> I could just as easily check @Child::Class::ISA or use UNIVERSAL::isa().
Child::Class->isa('Parent::Class')
--
This sig file te
On Thu, Jun 27, 2002 at 04:32:31PM +0200, Janek Schleicher wrote:
> I couldn't find a module doing this job on CPAN,
> so I'm ready to write a Test::Warn module.
>
> I thought that two methods should be implemented:
> warns_ok BLOCK REGEX, TEST_NAME (regex and test_name are optional)
> no_
On Fri, Jun 28, 2002 at 02:34:48PM -0500, Danny Faught wrote:
> I just tried to install Test::More 0.45 under Cygwin on Windows 2000.
> It fails the output test. Same results on two different machines, and
> also on version 0.44. I'm running perl 5.6.1. All other tests pass.
> All tests, incl
On Sun, Jun 30, 2002 at 05:37:14PM -0700, chromatic wrote:
> Here's a patch to the Test::Simple 0.45 distribution to make isa_ok() work with
> class names, not just objects. It tries to respect custom isa() methods, as
> well.
The purpose of isa_ok() is two fold:
Check that a scalar contain
On Mon, Jul 01, 2002 at 09:57:24AM -0500, Andy Lester wrote:
> I can do this:
>
> use PHP::Session 0.10;
>
> to ensure a version number, but I can't do this:
>
> use_ok( 'PHP::Session', '0.10' );
>
> because I get this error:
>
> alester@flr4[~/tw/Dev]$ more Modules.t
> #!/usr/bin/per
On Sun, Jun 16, 2002 at 08:28:26PM +0100, Adrian Howard wrote:
> >Now, the way I do this at the moment is have num_method_tests() walk up
> >the callstack until it finds a package that also isa Test::Class (in
> >this
> >case Base::Test) and then assume that is the class containing the method
> >
On Sun, Jun 16, 2002 at 03:12:17AM -0400, Michael G Schwern wrote:
> The Test::Harness::Straps part of 16938 has been defered until Pudge gets
> back to be with some more data. The patch only addresses the symptoms, the
> real problem is likely elsewhere.
> http:[EMAIL PROTECTED]/m
On Sun, Jun 16, 2002 at 12:14:59AM +0100, Adrian Howard wrote:
> 0) Do other people find this vaguely sane? Even possibly useful?
Yes! xUnit with a Perl spin is something I've wanted for a long time.
> 1) Is Test::Class the right name?
If you ignore the "it doesn't say it's xUnit" problem,
http://www.pobox.com/~schwern/src/Test-Harness-2.25.tar.gz
Some bleadperl fixes for the tests under MacPerl were integrated, but in a
slightly different form than the original patches. They've been simplified
which eliminates the need for VMS specific code to fix the MacOS specific
code.
The Te
On Sat, Jun 15, 2002 at 06:00:44PM +0100, Mark Fowler wrote:
> I was, out of curiousity, wondering what happened to these changes as they
> don't seem be in 5.8.0RC1
My time machine's in the shop awaiting a shipment of sky hooks.
(Translation: Arthur's patch came after RC1.)
As for why it's not
On Sat, Jun 08, 2002 at 11:12:40AM -0700, chromatic wrote:
> > > If this dependency information changes, it'll fail a test (or maybe warn)
> > > because there's a potential interface change that Bar.pm may need to
> > > know.
>
> > It looks interesting up to this point. Basically, everytime Bar.
On Sat, Jun 08, 2002 at 10:45:50AM -0700, chromatic wrote:
> Taking an average test suite as an example, we could have 'foo.t' and 'bar.t',
> testing Foo.pm and Bar.pm respectively. Bar depends on Foo, and bar.t mocks a
> couple of methods of Foo.
>
> If bar.t uses Test::Depend, it'll pick up se
http://www.pobox.com/~schwern/src/Test-Harness-2.24.tar.gz
Two bugs.
2.24 Wed May 29 19:02:18 EDT 2002
* Nikola Knezevic found a bug when tests are completely skipped
but no reason is given it was considered a failure.
* Made Test::Harness::Straps->analyze_file & Test::Harness a b
There was a big discussion about writing a module to make it easier to test
sets and common complex data structures and superceed the paltry eq_*
functions in Test::More.
http:[EMAIL PROTECTED]/msg01369.html
Anyone working towards that?
--
This sig file temporarily out of order.
http://www.pobox.com/~schwern/src/Test-Harness-2.23.tar.gz
One big bug, and the rest are VMS and MPE/iX fixes. Basically, you can't
know what the wait status will look like, you can only pull it appart with
POSIX macros.
Mark, could you confirm?
2.23 Wed May 22 12:59:47 EDT 2002
- reason
http://www.pobox.com/~schwern/src/Test-Harness-2.22.tar.gz
Little bug fix release. These are old bugs that only recently became
exposed.
2.22 Fri May 17 19:01:35 EDT 2002
- Fixed parsing of #!/usr/bin/perl-current to not see a -t.
(RT #574)
- Fixed exit codes on MPE/iX
2.21 Mon
en removed. It
caused more trouble than the old bug (I'd never seen a problem
before anyway)
- 2.20 broke $verbose
2.20 Sat May 4 22:31:20 EDT 2002
* An almost complete conversion of the Test::Harness test parsing
to use Test::Harness::Straps.
--
Michael G. Schwern
* An almost complete conversion of the Test::Harness test parsing
to use Test::Harness::Straps.
2.04 Tue Apr 30 00:54:49 EDT 2002
* Changing the output format of skips
- Taking into account VMS's special exit codes in the tests.
--
Michael G. Schwern <[EMAIL PROTECTED]>
e KEY;
chmod 0600, $identity;
# ok, now we should be able to start the rsync download
my @rsync_options = (
'-p',
'--partial',
'--size-only',
);
my $sour
the tests.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
I'm exploring my nipples.
g
so my brane isn't wired to think that way.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
"Let's face it," said bearded Rusty Simmons, opening a can after the
that's a good idea (the particulars of getting the output format would
be interesting), but it will require a lot of internal rejiggering.
With the exception of one feature (HARNESS_TODOFAIL), Test::Harness is
feature frozen for 5.8.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://w
d: I18N::Langinfo or POSIX unavailable
What do people think?
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Kids - don't try this at--oh, hell, go ahead, give it a whirl...
equire ripping apart Test::Harness's formatting
code, not something I want to do this close to 5.8. But if anyone has some
extra energy lying around, they could sweep through the skip messages in the
core tests and just shorten them a bit, that will hold things together for a
while.
--
Michael
uoted string "base" may clash with future reserved word at -e line 1.
>
> P.S. Mike, the same thing applies with your mixin.pm
gotcha
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]>
On Sat, Apr 13, 2002 at 04:18:24PM -0700, chromatic wrote:
> I'm not dead or pining for the fjords.
>
> This was discussed at the end of January on p5p, and Benjamin Goldberg
> suggested the regexp solution that appears here.
For future reference, TieOut.pm is sitting in t/lib/
Here's what I've
calar,
I've used a simplified version of your patch and also tested that isa_ok()
honors isa() overrides. Thanks.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
4 WHE
TB itself. Fixed by Dave Rolsky.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
The prefered method of receiving a paste enema is to go to St. Mark's
Place, stand in t
t; : "not ok\n"' });
}
use File::Find;
find(\&test , shift || '.');
adjust as necessary. Doesn't have to be fancy.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
sun readdened wheat stalks
bowing down in autumn sun
my mind wanders far
-- stimps
(bug reported by Wolfgang Weisselberg)
- Some point between Test::More 0.30 and 0.33 it became unsafe
to redirect STDOUT/STDERR in tests. This broke pod2test.
The minimum version of Test::More has been uped (again, thanks
Wolfgang)
--
Michael G. Schwern <[EMAIL PROTE
ns above and beyond Test::More. One
of these is fresh_perl() which runs a given chunk of code in a fresh
Perl process in a cross-platform manner. It's usually used to test
code that will cause a segfault, but's useful for what you want, too.
I've been meaning to make a CPAN versi
ived set objects
we'd be Smalltalk. TMTOWTDI. Live it. Love it. Work with it. Send
lamentations to the contrary to comp.lang.perl.misc. :)
(Really the whole problem could never had arisen if you hadn't let an
ECE dropout redesign Perl's testing infrastructure ;) )
--
is_deeply().
Again, they are *NOT TEST FUNCTIONS*. They produce no diagnostics.
They are just normal comparision functions and becoming more and more
out of place in Test::More.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Qu
On Thu, Apr 11, 2002 at 10:37:10AM +0900, Curt Sampson wrote:
> On Tue, 9 Apr 2002, Michael G Schwern wrote:
>
> > > I'm not sure exactly what the purpose of this is; your test will
> > > still fail if it dies even when not in a lives_ok block, right?
> >
>
On Wed, Apr 10, 2002 at 10:57:09PM +0100, Adrian Howard wrote:
> Hmmm... All seems sensible. Patch attached for Builder.pm that adds a
> _may_be_regex method. Okay?
Except it should be public (if Test::Exception wants to use it) and
documented and tested. :)
--
Michael G. Schwern &
on checks
that the values referenced are equal. Go figure.
Either way, you usually want to be shallow for testing.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
If you'll mount me, I'll let you bomb Canada until they swoon.
erwise. So there's no concept of which is "expected" and which is
"got" anymore than:
$got eq $expected
$expected eq $got
Test::More's eq_set() is just a bad name. Don't fixate on it, write
Test module with better set handling.
--
Michael G. Schwern <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
It's Flypaper Licking time!
> The problem, in my view, is that perl lets you pass it something
> which is not a set. Thus, it seems perfectly fair to me for it to
> produce undefined behaviour under such circumstances.
No, Mark is right. It's poorly named because the author doesn't
really understan
/(.*)/ (\w*) $ }sx ) {
> $usable_regex = "(?$opts)$re";
> }
You could even tear that out of Test::Builder->like and into it's own
Test::Builder->may_be_regex method so you don't have to duplicate
code.
--
Michael G. Schwern <[EMAIL PROTECTED]>
looks great, however. Ideally it should end up in Test::More
> at some point, I would think.
Nope. No more functions in Test::More, too much in there already.
I want to encourage the idea of having more than one Test::* module in
use in a test.
--
Michael G. Schwern <[EMAIL PROTEC
ant to guarantee that $@ will be how it died so you can do:
dies_ok { div(1,0) } 'div by zero';
like( $@, qr/^Illegal division by zero/ );
Even though you can use throws_ok(), the dies_ok() + $@ combo is more
flexible more processing than just a regex needs to be done o
On Tue, Apr 09, 2002 at 05:02:32PM +0100, Mark Fowler wrote:
> On Tue, 9 Apr 2002, Michael G Schwern wrote:
>
> > On Tue, Apr 09, 2002 at 03:26:21PM +0100, Mark Fowler wrote:
> > > There's a lot of other problems like that. So I was thinking of writing
> > >
On Tue, Apr 09, 2002 at 03:26:21PM +0100, Mark Fowler wrote:
> There's a lot of other problems like that. So I was thinking of writing
> Test::Sloppy (aka Test::Fuzzy, aka...)
What would it do?
(I can show you lots of sloppy tests if you like. :)
--
Michael G. Schwern <[E
onality isn't really complete.
I'd encourage you to write a Test::Builder based module that does more
complete set & complex data testing. Either talk to Barrie about
adding it to Test::Differences or start a new module. Test::Set,
Test::Data::Deep, etc...
--
Michael G. Schwern &
gt; if( $num > @Test_Results ) {
> -for ($#Test_Results..$num-1) {
> + my $start = @Test_Results ? $#Test_Results : 0;
> +for ($start..$num-1) {
> $Test_Results[$_] = 1;
> }
> }
--
Michael G. S
On Tue, Mar 26, 2002 at 01:47:38PM +0900, Curt Sampson wrote:
> On Mon, 25 Mar 2002, Michael G Schwern wrote:
>
> > > 2. Skip test of code where dependencies have been tested and found
> > > to be failing. For example, if the test for the database connectio
gt; the docs say otherwise:
>
> Like "analyze", but it reads from the given $test_file.
>
> Well, analyze reads test results, so presumbly the documentation
> is saying that this is supposed to be a file containing the test
> results, not the test code. Hmmm.
Nope.
On Mon, Mar 18, 2002 at 02:14:23PM -0700, Sean M. Burke wrote:
> At 03:26 2002-03-18 -0500, Michael G Schwern wrote:
> >[...]Use alarm and skip the test if $Config{d_alarm} is false (see
> >t/op/alarm.t for an example). If you think the infinite loop is due
> >to a programmi
1 - 100 of 395 matches
Mail list logo