r62789 - in /trunk/libtest-warn-perl/debian: changelog patches/language.patch
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Wed Sep 22 08:10:49 UTC 2010
Author: periapt-guest
Date: Wed Sep 22 08:10:03 2010
New Revision: 62789
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62789
Log:
Reviewed language.patch line by line.
Modified:
trunk/libtest-warn-perl/debian/changelog
trunk/libtest-warn-perl/debian/patches/language.patch
Modified: trunk/libtest-warn-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-warn-perl/debian/changelog?rev=62789&op=diff
==============================================================================
--- trunk/libtest-warn-perl/debian/changelog (original)
+++ trunk/libtest-warn-perl/debian/changelog Wed Sep 22 08:10:03 2010
@@ -10,9 +10,7 @@
* Removed quilt as a dependency and added debian/source/format
* Refreshed copyright
* Refreshed description
-
- [ gregor herrmann ]
- * Refresh patch, was partly adopted upstream.
+ * Reviewed language.patch line by line.
-- Nicholas Bamber <nicholas at periapt.co.uk> Wed, 15 Sep 2010 22:05:07 +0100
Modified: trunk/libtest-warn-perl/debian/patches/language.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-warn-perl/debian/patches/language.patch?rev=62789&op=diff
==============================================================================
--- trunk/libtest-warn-perl/debian/patches/language.patch (original)
+++ trunk/libtest-warn-perl/debian/patches/language.patch Wed Sep 22 08:10:03 2010
@@ -2,10 +2,11 @@
Description: Patch from Era Eriksson to clean up some manpage language
Bug-Debian: #322351
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=49519
-
+Reviewed-by: Nicholas Bamber <nicholas at periapt.co.uk>
+Last-Update: 2010-09-22
--- a/Warn.pm
+++ b/Warn.pm
-@@ -15,7 +15,7 @@ Test::Warn - Perl extension to test meth
+@@ -15,7 +15,7 @@
warning_like {foo(-dri => "/")} qr/unknown param/i, "an unknown parameter test";
warnings_like {bar(1,1)} [qr/width.*small/i, qr/height.*small/i];
@@ -14,35 +15,45 @@
warnings_like {foo()} [qr/undefined/,qr/undefined/,{carped => qr/no result/i}];
warning_like {foo(undef)} 'uninitialized';
-@@ -31,7 +31,7 @@ Test::Warn - Perl extension to test meth
+@@ -31,9 +31,9 @@
A good style of Perl programming calls for a lot of diverse regression tests.
-This module provides a few convenience methods for testing warning based code.
+This module provides a few convenience methods for testing warning based-code.
- If you are not already familiar with the Test::More manpage
+-If you are not already familiar with the Test::More manpage
++If you are not already familiar with the L<Test::More> manpage,
now would be the time to go take a look.
-@@ -46,25 +46,25 @@ Tests that BLOCK gives exactly the one s
- The test fails if the BLOCK warns more then one times or doesn't warn.
+
+ =head2 FUNCTIONS
+@@ -42,29 +42,28 @@
+
+ =item warning_is BLOCK STRING, TEST_NAME
+
+-Tests that BLOCK gives exactly the one specified warning.
+-The test fails if the BLOCK warns more then one times or doesn't warn.
++Tests that BLOCK gives the specified warning exactly once.
++The test fails if the BLOCK warns more than once or does not warn at all.
If the string is undef,
then the tests succeeds if the BLOCK doesn't give any warning.
-Another way to say that there aren't any warnings in the block,
-is C<warnings_are {foo()} [], "no warnings in">.
-+Another way to say that there aren't any warnings in the block
++Another way to say that there are no warnings in the block
+is C<warnings_are {foo()} [], "no warnings">.
-If you want to test for a warning given by carp,
-You have to write something like:
-+If you want to test for a warning given by carp
++If you want to test for a warning given by Carp
+you have to write something like:
C<warning_is {carp "msg"} {carped =E<gt> 'msg'}, "Test for a carped warning">.
-The test will fail,
-+The test will fail
- if a "normal" warning is found instead of a "carped" one.
+-if a "normal" warning is found instead of a "carped" one.
++The test will fail if a "normal" warning is found instead of a "carped" one.
Note: C<warn "foo"> would print something like C<foo at -e line 1>.
- This method ignores everything after the at. That means, to match this warning
+-This method ignores everything after the at. That means, to match this warning
++This method ignores everything after the "at". Thus to match this warning
you would have to call C<warning_is {warn "foo"} "foo", "Foo succeeded">.
If you need to test for a warning at an exactly line,
-try better something like C<warning_like {warn "foo"} qr/at XYZ.dat line 5/>.
@@ -52,11 +63,11 @@
So you also could write
C<warning_is {foo()} [], "no warning"> or something similar.
-I decided to give two methods to have some better readable method names.
-+I decided to give two methods to have some more readable method names.
++I decided to give two methods the same name to improve readability.
A true value is returned if the test succeeds, false otherwise.
-@@ -74,32 +74,32 @@ The test name is optional, but recommend
+@@ -74,32 +73,32 @@
=item warnings_are BLOCK ARRAYREF, TEST_NAME
Tests to see that BLOCK gives exactly the specified warnings.
@@ -69,11 +80,11 @@
Please read also the notes to warning_is as these methods are only aliases.
-If you want more than one tests for carped warnings look that way:
-+If you want more than one test for carped warnings, try this:
++If you want more than one test for carped warnings, try this:
C<warnings_are {carp "c1"; carp "c2"} {carped => ['c1','c2'];> or
C<warnings_are {foo()} ["Warning 1", {carped => ["Carp 1", "Carp 2"]}, "Warning 2"]>.
-Note that C<{carped => ...}> has always to be a hash ref.
-+Note that C<{carped => ...}> always has to be a hash ref.
++Note that C<{carped => ...}> must always be a hash ref.
=item warning_like BLOCK REGEXP, TEST_NAME
@@ -86,13 +97,13 @@
-The REGEXP is matched after the whole warn line,
-which consists in general of "WARNING at __FILE__ line __LINE__".
-So you can check for a warning in at File Foo.pm line 5 with
-+The REGEXP is matched sagainst the whole warning line,
++The REGEXP is matched against the whole warning line,
+which in general has the form "WARNING at __FILE__ line __LINE__".
+So you can check for a warning in the file Foo.pm on line 5 with
C<warning_like {bar()} qr/at Foo.pm line 5/, "Testname">.
-I don't know whether it's sensful to do such a test :-(
-However, you should be prepared as a matching with 'at', 'file', '\d'
-+Perhaps it isn't sensible to perform such a test;
++Perhaps it is not sensible to perform such a test;
+however, you should be aware that matching on a sweeping regular expression
or similar will always pass.
-Think to the qr/^foo/ if you want to test for warning "foo something" in file foo.pl.
@@ -100,16 +111,16 @@
You can also write the regexp in a string as "/.../"
instead of using the qr/.../ syntax.
-@@ -107,7 +107,7 @@ Note that the slashes are important in t
+@@ -107,7 +106,7 @@
as strings without slashes are reserved for warning categories
(to match warning categories as can be seen in the perllexwarn man page).
-Similar to C<warning_is>,
-+As with C<warning_is>,
++As with C<warning_is>,
you can test for warnings via C<carp> with:
C<warning_like {bar()} {carped => qr/bar called too early/i};>
-@@ -123,17 +123,17 @@ The test name is optional, but recommend
+@@ -123,17 +122,17 @@
Tests whether a BLOCK gives exactly one warning of the passed category.
The categories are grouped in a tree,
like it is expressed in perllexwarn.
@@ -120,7 +131,7 @@
+Note that they have the hierarchical structure from perl 5.8.0,
+you can access the internal hierarchy with
+C<$Test::Warn::Categorization::tree>,
-+although it isn't recommended.
++although it isn't recommended).
Thanks to the grouping in a tree,
-it's simple possible to test for an 'io' warning,
@@ -135,7 +146,7 @@
warning_like {eval q/"$x"; $x;/}
[qw/void uninitialized/],
-@@ -142,9 +142,8 @@ can only be catched in an eval block. So
+@@ -142,9 +141,8 @@
will work,
while it wouldn't work without the eval.
@@ -147,7 +158,7 @@
=item warnings_like BLOCK ARRAYREF, TEST_NAME
-@@ -164,7 +163,7 @@ and for warning categories, too:
+@@ -164,7 +162,7 @@
{carped => qr/bar warning/i},
'io'
],
@@ -156,17 +167,18 @@
=item warnings_exist BLOCK STRING|ARRAYREF, TEST_NAME
-@@ -190,27 +189,28 @@ C<warnings_exist> by default.
+@@ -189,32 +187,32 @@
+
=head1 BUGS
- Please note that warnings with newlines inside are making a lot of trouble.
+-Please note that warnings with newlines inside are making a lot of trouble.
-The only sensible way to handle them is to use are the C<warning_like> or
-C<warnings_like> methods. Background for these problems is that there is no
-really secure way to distinguish between warnings with newlines and a tracing
-+The only sensible way to handle them is to use the C<warning_like> or
-+C<warnings_like> methods.
-+The background for these problems is that there is no
-+really secure way to distinguish between warnings with newlines and a triling
++Please note that warnings with newlines inside are very awkward.
++The only sensible way to handle them is to use the C<warning_like> or
++C<warnings_like> methods. The background is that there is no
++really safe way to distinguish between warnings with newlines and a
stacktrace.
-If a method has it's own warn handler,
@@ -178,7 +190,7 @@
-Please use this calling style with higher attention and
-tell me if you find a bug.
+The C<warning_like BLOCK CATEGORY, TEST_NAME> method isn't fully tested.
-+Please pay attention if you use this this calling style,
++Please take note if you use this this calling style,
+and report any bugs you find.
=head1 TODO
@@ -194,77 +206,8 @@
=head1 SEE ALSO
---- a/t/warning_is.t
-+++ b/t/warning_is.t
-@@ -77,7 +77,7 @@ sub _found_warn_msg {
- __FILE__,
- "line",
- WARN_LINE . ".") )
-- : "didn't found a warning";
-+ : "didn't find a warning";
- }
-
- sub _exp_warn_msg {
-@@ -94,7 +94,7 @@ sub _found_carp_msg {
- __FILE__,
- "line",
- CARP_LINE) ) # Note the difference, that carp msg
-- : "didn't found a warning"; # aren't finished by '.'
-+ : "didn't find a warning"; # aren't finished by '.'
- }
-
- sub _exp_carp_msg {
---- a/t/warning_like.t
-+++ b/t/warning_like.t
-@@ -80,7 +80,7 @@ sub _found_warn_msg {
- __FILE__,
- "line",
- WARN_LINE . ".") )
-- : "didn't found a warning";
-+ : "didn't find a warning";
- }
-
- sub _exp_warn_msg {
-@@ -97,7 +97,7 @@ sub _found_carp_msg {
- __FILE__,
- "line",
- CARP_LINE) ) # Note the difference, that carp msg
-- : "didn't found a warning"; # aren't finished by '.'
-+ : "didn't find a warning"; # aren't finished by '.'
- }
-
- sub _exp_carp_msg {
---- a/t/warnings_are.t
-+++ b/t/warnings_are.t
-@@ -81,12 +81,12 @@ sub test_warnings_are {
-
- sub _found_warn_msg {
- @_ ? map({"found warning: $_ at ". __FILE__ . " line " . WARN_LINE . "." } @_)
-- : "didn't found a warning";
-+ : "didn't find a warning";
- }
-
- sub _found_carp_msg {
- @_ ? map({"found carped warning: $_ at ". __FILE__ . " line " . CARP_LINE} @_)
-- : "didn't found a warning";
-+ : "didn't find a warning";
- }
-
-
---- a/t/warnings_like.t
-+++ b/t/warnings_like.t
-@@ -84,12 +84,12 @@ sub test_warnings_like {
-
- sub _found_warn_msg {
- @_ ? map({"found warning: $_ at ". __FILE__ . " line " . WARN_LINE . "." } @_)
-- : "didn't found a warning";
-+ : "didn't find a warning";
- }
-
- sub _found_carp_msg {
- @_ ? map({"found carped warning: $_ at ". __FILE__ . " line " . CARP_LINE} @_)
-- : "didn't found a warning";
-+ : "didn't find a warning";
- }
-
-
+-Have a look to the similar L<Test::Exception> module. Test::Trap
++Have a look to the similar L<Test::Exception> module. L<Test::Trap>
+
+ =head1 THANKS
+
More information about the Pkg-perl-cvs-commits
mailing list