Add ARM files
[dh-make-perl] / dev / arm / libtest-warn-perl / libtest-warn-perl-0.11 / debian / patches / language.patch
1 Author: Jay Bonci <jaybonci@debian.org>
2 Description: Patch from Era Eriksson to clean up some manpage language
3 Bug: #322351
4
5 --- a/Warn.pm
6 +++ b/Warn.pm
7 @@ -9,13 +9,13 @@
8    warning_is    {foo(-dri => "/")} "Unknown Parameter 'dri'", "dri != dir gives warning";
9    warnings_are  {bar(1,1)} ["Width very small", "Height very small"];
10  
11 -  warning_is    {add(2,2)} undef, "No warning to calc 2+2"; # or
12 -  warnings_are  {add(2,2)} [],    "No warning to calc 2+2"; # what reads better :-)
13 +  warning_is    {add(2,2)} undef, "No warning for calc 2+2"; # or
14 +  warnings_are  {add(2,2)} [],    "No warning for calc 2+2"; # what reads better :-)
15  
16    warning_like  {foo(-dri => "/")} qr/unknown param/i, "an unknown parameter test";
17    warnings_like {bar(1,1)} [qr/width.*small/i, qr/height.*small/i];
18  
19 -  warning_is    {foo()} {carped => "didn't found the right parameters"};
20 +  warning_is    {foo()} {carped => "didn't find the right parameters"};
21    warnings_like {foo()} [qr/undefined/,qr/undefined/,{carped => qr/no result/i}];
22  
23    warning_like {foo(undef)}                 'uninitialized';
24 @@ -27,9 +27,9 @@
25  
26  =head1 DESCRIPTION
27  
28 -This module provides a few convenience methods for testing warning based code.
29 +This module provides a few convenience methods for testing warning-based code.
30  
31 -If you are not already familiar with the Test::More manpage 
32 +If you are not already familiar with the Test::More manpage,
33  now would be the time to go take a look.
34  
35  =head2 FUNCTIONS
36 @@ -38,29 +38,29 @@
37  
38  =item warning_is BLOCK STRING, TEST_NAME
39  
40 -Tests that BLOCK gives exactly the one specificated warning.
41 -The test fails if the BLOCK warns more then one times or doesn't warn.
42 +Tests that BLOCK give exactly the one specified warning.
43 +The test fails if the BLOCK warns more then one time or doesn't warn.
44  If the string is undef, 
45  then the tests succeeds iff the BLOCK doesn't give any warning.
46 -Another way to say that there aren't ary warnings in the block,
47 -is C<warnings_are {foo()} [], "no warnings in">.
48 +Another way to say that there aren't any warnings in the block
49 +is C<warnings_are {foo()} [], "no warnings">.
50  
51 -If you want to test for a warning given by carp,
52 -You have to write something like:
53 +If you want to test for a warning given by carp
54 +you have to write something like:
55  C<warning_is {carp "msg"} {carped =E<gt> 'msg'}, "Test for a carped warning">.
56 -The test will fail,
57 +The test will fail
58  if a "normal" warning is found instead of a "carped" one.
59  
60  Note: C<warn "foo"> would print something like C<foo at -e line 1>. 
61  This method ignores everything after the at. That means, to match this warning
62  you would have to call C<warning_is {warn "foo"} "foo", "Foo succeeded">.
63  If you need to test for a warning at an exactly line,
64 -try better something like C<warning_like {warn "foo"} qr/at XYZ.dat line 5/>.
65 +try something like C<warning_like {warn "foo"} qr/at XYZ.dat line 5/>.
66  
67  warning_is and warning_are are only aliases to the same method.
68  So you also could write
69  C<warning_is {foo()} [], "no warning"> or something similar.
70 -I decided me to give two methods to have some better readable method names.
71 +I decided to give two methods to have some more readable method names.
72  
73  A true value is returned if the test succeeds, false otherwise.
74  
75 @@ -70,32 +70,33 @@
76  =item warnings_are BLOCK ARRAYREF, TEST_NAME
77  
78  Tests to see that BLOCK gives exactly the specificated warnings.
79 -The test fails if the BLOCK warns a different number than the size of the ARRAYREf
80 -would have expected.
81 +The test fails if the warnings from BLOCK are not exactly the ones in ARRAYREF.
82  If the ARRAYREF is equal to [], 
83  then the test succeeds iff the BLOCK doesn't give any warning.
84  
85  Please read also the notes to warning_is as these methods are only aliases.
86  
87 -If you want more than one tests for carped warnings look that way:
88 +If you want more than one test for carped warnings, try this:
89  C<warnings_are {carp "c1"; carp "c2"} {carped => ['c1','c2'];> or
90  C<warnings_are {foo()} ["Warning 1", {carped => ["Carp 1", "Carp 2"]}, "Warning 2"]>.
91 -Note that C<{carped => ...}> has always to be a hash ref.
92 +Note that C<{carped => ...}> always has to be a hash ref.
93  
94  =item warning_like BLOCK REGEXP, TEST_NAME
95  
96 -Tests that BLOCK gives exactly one warning and it can be matched to the given regexp.
97 +Tests that BLOCK gives exactly one warning and it can be matched by
98 +the given regexp.
99  If the string is undef, 
100  then the tests succeeds iff the BLOCK doesn't give any warning.
101  
102 -The REGEXP is matched after the whole warn line,
103 -which consists in general of "WARNING at __FILE__ line __LINE__".
104 -So you can check for a warning in at File Foo.pm line 5 with
105 +The REGEXP is matched against the whole warning message,
106 +which in general has the form "WARNING at __FILE__ line __LINE__".
107 +So you can check for a warning in the file Foo.pm on line 5 with
108  C<warning_like {bar()} qr/at Foo.pm line 5/, "Testname">.
109 -I don't know whether it's sensful to do such a test :-(
110 -However, you should be prepared as a matching with 'at', 'file', '\d'
111 +Perhaps it isn't sensible to perform such a test;
112 +however, you should be aware that matching on a sweeping regular expression
113 +such as 'at', 'file', '\d'
114  or similar will always pass. 
115 -Think to the qr/^foo/ if you want to test for warning "foo something" in file foo.pl.
116 +Consider qr/^foo/ if you want to test for warning "foo something" in file foo.pl.
117  
118  You can also write the regexp in a string as "/.../"
119  instead of using the qr/.../ syntax.
120 @@ -103,7 +104,7 @@
121  as strings without slashes are reserved for warning categories
122  (to match warning categories as can be seen in the perllexwarn man page).
123  
124 -Similar to C<warning_is>,
125 +As with C<warning_is>,
126  you can test for warnings via C<carp> with:
127  C<warning_like {bar()} {carped => qr/bar called too early/i};>
128  
129 @@ -119,17 +120,18 @@
130  Tests whether a BLOCK gives exactly one warning of the passed category.
131  The categories are grouped in a tree,
132  like it is expressed in perllexwarn.
133 -Note, that they have the hierarchical structure from perl 5.8.0,
134 -wich has a little bit changed to 5.6.1 or earlier versions
135 -(You can access the internal used tree with C<$Test::Warn::Categorization::tree>, 
136 -allthough I wouldn't recommend it)
137 +Note that they have the hierarchical structure from perl 5.8.0,
138 +which is slightly different from how it was organized up through perl 5.6.1.
139 +(You can access the internal hierarchy with
140 +C<$Test::Warn::Categorization::tree>,
141 +although it isn't recommended).
142  
143  Thanks to the grouping in a tree,
144 -it's simple possible to test for an 'io' warning,
145 -instead for testing for a 'closed|exec|layer|newline|pipe|unopened' warning.
146 +it's possible to test simply for an 'io' warning,
147 +instead of testing for a 'closed|exec|layer|newline|pipe|unopened' warning.
148  
149 -Note, that warnings occuring at compile time,
150 -can only be catched in an eval block. So
151 +Note that compile-time warnings
152 +can only be caught in an eval block. So
153  
154    warning_like {eval q/"$x"; $x;/} 
155                 [qw/void uninitialized/], 
156 @@ -138,9 +140,8 @@
157  will work,
158  while it wouldn't work without the eval.
159  
160 -Note, that it isn't possible yet,
161 -to test for own categories,
162 -created with warnings::register.
163 +Note also that it isn't yet possible
164 +to test for categories you created yourself with C<warnings::register>.
165  
166  =item warnings_like BLOCK ARRAYREF, TEST_NAME
167  
168 @@ -160,7 +161,7 @@
169                   {carped => qr/bar warning/i},
170                   'io'
171                  ],
172 -                "I hope, you'll never have to write a test for so many warnings :-)";
173 +                "I hope you'll never have to write a test for so many warnings :-)";
174  
175  =back
176  
177 @@ -174,27 +175,28 @@
178  =head1 BUGS
179  
180  Please note that warnings with newlines inside are making a lot of trouble.
181 -The only sensful way to handle them is to use are the C<warning_like> or
182 -C<warnings_like> methods. Background for these problems is that there is no
183 -really secure way to distinguish between warnings with newlines and a tracing
184 +The only sensible way to handle them is to use the C<warning_like> or
185 +C<warnings_like> methods.
186 +The background for these problems is that there is no
187 +really secure way to distinguish between warnings with newlines and a trailing
188  stacktrace.
189  
190 -If a method has it's own warn handler,
191 +If a method has its own warn handler,
192  overwriting C<$SIG{__WARN__}>,
193  my test warning methods won't get these warnings.
194  
195 -The C<warning_like BLOCK CATEGORY, TEST_NAME> method isn't extremely tested.
196 -Please use this calling style with higher attention and
197 -tell me if you find a bug.
198 +The C<warning_like BLOCK CATEGORY, TEST_NAME> method isn't fully tested.
199 +Please pay attention if you use this this calling style,
200 +and report any bugs you find.
201  
202  =head1 TODO
203  
204  Improve this documentation.
205  
206  The code has some parts doubled - especially in the test scripts.
207 -This is really awkward and has to be changed.
208 +This is really awkward and must be changed.
209  
210 -Please feel free to suggest me any improvements.
211 +Please feel free to suggest improvements.
212  
213  =head1 SEE ALSO
214  
215 @@ -359,7 +361,7 @@
216              $Tester->diag( "found warning: $_" );
217          }
218      }
219 -    $Tester->diag( "didn't found a warning" ) unless @_;
220 +    $Tester->diag( "didn't find a warning" ) unless @_;
221  }
222  
223  sub _diag_exp_warning {
224 --- a/t/warning_is.t
225 +++ b/t/warning_is.t
226 @@ -77,7 +77,7 @@
227                           __FILE__,
228                           "line",
229                           WARN_LINE . ".") )
230 -        : "didn't found a warning";
231 +        : "didn't find a warning";
232  }
233  
234  sub _exp_warn_msg {
235 @@ -94,7 +94,7 @@
236                           __FILE__,
237                           "line",
238                           CARP_LINE) )     # Note the difference, that carp msg
239 -        : "didn't found a warning";       # aren't finished by '.'
240 +        : "didn't find a warning";       # aren't finished by '.'
241  }
242  
243  sub _exp_carp_msg {
244 --- a/t/warning_like.t
245 +++ b/t/warning_like.t
246 @@ -79,7 +79,7 @@
247                           __FILE__,
248                           "line",
249                           WARN_LINE . ".") )
250 -        : "didn't found a warning";
251 +        : "didn't find a warning";
252  }
253  
254  sub _exp_warn_msg {
255 @@ -96,7 +96,7 @@
256                           __FILE__,
257                           "line",
258                           CARP_LINE) )     # Note the difference, that carp msg
259 -        : "didn't found a warning";       # aren't finished by '.'
260 +        : "didn't find a warning";       # aren't finished by '.'
261  }
262  
263  sub _exp_carp_msg {
264 --- a/t/warnings_are.t
265 +++ b/t/warnings_are.t
266 @@ -81,12 +81,12 @@
267  
268  sub _found_warn_msg {
269      @_ ? map({"found warning: $_ at ". __FILE__ . " line " . WARN_LINE . "." } @_)
270 -       : "didn't found a warning";
271 +       : "didn't find a warning";
272  }
273  
274  sub _found_carp_msg {
275      @_ ? map({"found carped warning: $_ at ". __FILE__ . " line " . CARP_LINE} @_)
276 -       : "didn't found a warning";
277 +       : "didn't find a warning";
278  }
279  
280  
281 --- a/t/warnings_like.t
282 +++ b/t/warnings_like.t
283 @@ -83,12 +83,12 @@
284  
285  sub _found_warn_msg {
286      @_ ? map({"found warning: $_ at ". __FILE__ . " line " . WARN_LINE . "." } @_)
287 -       : "didn't found a warning";
288 +       : "didn't find a warning";
289  }
290  
291  sub _found_carp_msg {
292      @_ ? map({"found carped warning: $_ at ". __FILE__ . " line " . CARP_LINE} @_)
293 -       : "didn't found a warning";
294 +       : "didn't find a warning";
295  }
296  
297