From: Vincent Pit Date: Wed, 29 Dec 2010 16:53:42 +0000 (+0100) Subject: This is 0.02 X-Git-Tag: v0.02^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=2f062217460c40eef7ce43bf273e3f8c09e0673c;p=perl%2Fmodules%2FTest-Leaner.git This is 0.02 --- diff --git a/Changes b/Changes index 6360be4..8aada79 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,19 @@ Revision history for Test-Leaner +0.02 2010-12-29 17:00 UTC + + Add : You can fall back to use Test::More by setting the + PERL_TEST_LEANER_USES_TEST_MORE environment variable. + + Doc : Document the restrictions on the regexp argument of like() and + unlike(). + Thanks Sébastien Aperghis-Tramoni for spotting this. + + Doc : Document that is_deeply() doesn't check for memory cycles. + + Fix : The plan will now correctly be printed at the end when + 'no_plan' was specified and some tests were failing. + + Fix : Only print an ending plan once when the process is forked. + + Opt : is_deeply() was optimized for large datastructures. + + Rem : Scalar::Util is no longer an hard dependency. It will be used + if it is present, but a fallback implementation is bundled. + 0.01 2010-12-28 17:00 UTC First version, released on an unsuspecting world. diff --git a/META.yml b/META.yml index 57623e3..d836270 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: Test-Leaner -version: 0.01 +version: 0.02 abstract: A slimmer Test::More for when you favor performance over completeness. author: - Vincent Pit @@ -11,13 +11,11 @@ configure_requires: build_requires: Exporter: 0 ExtUtils::MakeMaker: 0 - Scalar::Util: 0 Test::More: 0 requires: - Exporter: 0 - perl: 5.006 - Scalar::Util: 0 - Test::More: 0 + Exporter: 0 + perl: 5.006 + Test::More: 0 resources: bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Leaner homepage: http://search.cpan.org/dist/Test-Leaner/ diff --git a/README b/README index 8bdc1f5..f8fd072 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ NAME completeness. VERSION - Version 0.01 + Version 0.02 SYNOPSIS use Test::Leaner tests => 10_000; @@ -31,11 +31,21 @@ DESCRIPTION * "pass", "fail", "ok", "is", "isnt", "like", "unlike" and "cmp_ok" are all guaranteed to return the truth value of the test. + * "like" and "unlike" don't special case regular expressions that are + passed as '/.../' strings. A string regexp argument is always + treated as a the source of the regexp, making "like $text, $rx" and + "like $text, qr[$rx]" equivalent to each other and to "cmp_ok $text, + '=~', $rx" (and likewise for "unlike"). + * "cmp_ok" throws an exception if the given operator isn't a valid Perl binary operator (except '=' and variants). It also tests in scalar context, so '..' will be treated as the flip-flop operator and not the range operator. + * "is_deeply" doesn't guard for memory cycles. If the two first + arguments present parallel memory cycles, the test may result in an + infinite loop. + * The tests don't output any kind of default diagnostic in case of failure ; the rationale being that if you have a large number of tests and a lot of them are failing, then you don't want to be @@ -44,27 +54,69 @@ DESCRIPTION * "use_ok", "require_ok", "can_ok", "isa_ok", "new_ok", "subtest", "explain", "TODO" blocks and "todo_skip" are not implemented. - * Test::Leaner depends on Scalar::Util, while Test::More does not. +ENVIRONMENT + "PERL_TEST_LEANER_USES_TEST_MORE" + If this environment variable is set, Test::Leaner will replace its + functions by those from Test::More. Moreover, the symbols that are + imported you "use Test::Leaner" will be those from Test::More, but you + can still only import the symbols originally defined in Test::Leaner + (hence the functions from Test::More that are not implemented in + Test::Leaner will not be imported). If your version of Test::More is too + old and doesn't have some symbols (like "note" or "done_testing"), they + will be replaced in Test::Leaner by croaking stubs. + + This may be useful if your Test::Leaner-based test script fails and you + want extra diagnostics. FUNCTIONS The following functions from Test::More are implemented and exported by default. "plan [ tests => $count | 'no_plan' | skip_all => $reason ]" + See "plan" in Test::More. + "skip $reason => $count" + See "skip" in Test::More. + "done_testing [ $count ]" + See "done_testing" in Test::More. + "ok $ok [, $desc ]" + See "ok" in Test::More. + "pass [ $desc ]" + See "pass" in Test::More. + "fail [ $desc ]" + See "fail" in Test::More. + "is $got, $expected [, $desc ]" + See "is" in Test::More. + "isnt $got, $expected [, $desc ]" + See "isnt" in Test::More. + "like $got, $regexp_expected [, $desc ]" + See "like" in Test::More. + "unlike $got, $regexp_expected, [, $desc ]" + See "unlike" in Test::More. + "cmp_ok $got, $op, $expected [, $desc ]" + See "cmp_ok" in Test::More. + "is_deeply $got, $expected [, $desc ]" + See "is_deeply" in Test::More. + "diag @text" + See "diag" in Test::More. + "note @text" + See "note" in Test::More. + "BAIL_OUT [ $desc ]" + See "BAIL_OUT" in Test::More. + Test::Leaner also provides some functions of its own, which are never exported. @@ -96,7 +148,7 @@ FUNCTIONS DEPENDENCIES perl 5.6. - Exporter, Scalar::Util, Test::More. + Exporter, Test::More. AUTHOR Vincent Pit, "", . diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index 3881656..3365006 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -10,11 +10,11 @@ Test::Leaner - A slimmer Test::More for when you favor performance over complete =head1 VERSION -Version 0.01 +Version 0.02 =cut -our $VERSION = '0.01'; +our $VERSION = '0.02'; =head1 SYNOPSIS