Debian Codegraph @

Changes

raw
1 Revision history for Perl extension Carp::Assert::More.
2
3 2.9.0 Wed Mar 5 22:27:28 CST 2025
4
5 [ENHANCEMENTS]
6 assert_arrayref_of() no longer requires the array to have at
7 least one element.
8
9 New assert_arrayref_nonempty_of() has the same behavior as
10 assert_arrayref_of(), but requires at least one element.
11
12
13 2.8.0 Fri Jan 3 12:03:58 CST 2025
14 [ENHANCEMENTS]
15 Added assert_regex().
16
17
18 2.7.0 Wed Dec 25 14:40:15 CST 2024
19 [ENHANCEMENTS]
20 Added assert_numeric_between() and assert_integer_between().
21
22
23 2.6.0 Sun Dec 22 23:37:00 CST 2024
24 [ENHANCEMENTS]
25 Add assert(), the same as assert() in Carp::Assert, as a
26 convenience.
27
28 Add assert_and(), assert_or() and assert_xor() for more helpful
29 stacktraces.
30
31
32 2.5.0 Fri Oct 25 14:46:06 CDT 2024
33 [ENHANCEMENTS]
34 Add assert_context_list() function.
35
36 Add assert_context_void() function.
37
38
39 2.4.0 Mon Mar 4 21:54:07 CST 2024
40 [ENHANCEMENTS]
41 New function assert_arrayref_all() calls an assertion function for every element in the array.
42
43 my $aref_of_counts = get_counts();
44 assert_arrayref_all( $aref, \&assert_positive_integer, 'Counts are positive' );
45
46 assert_context_scalar() now provides a default message of
47 "function_name must be called in scalar context".
48
49 assert_context_nonvoid() now provide a default message of
50 "function_name must not be called in void context".
51
52
53 2.3.0 Tue May 30 21:52:20 CDT 2023
54 [ENHANCEMENTS]
55 Added assert_arrayref_of() to verify that all of the elements
56 in an arrayref are of a given type. For example:
57
58 my $users = get_users();
59 assert_arrayref_of( $users, 'My::User' );
60
61
62 2.2.0 Sun Jan 29 20:23:59 CST 2023
63 [ENHANCEMENTS]
64 Added assert_cmp( $x, $op, $y [, $msg] ), analogous to cmp_ok in Test::More, so you can do
65 assert_cmp( $n, '>', 10 );
66 which will give better diagnostics than just
67 assert( $n > 10 );
68 Operators supported are: lt le gt ge == != > >= < <=
69
70 assert_all_keys_in() now lists all key failures in the message, not just the first one.
71
72 assert_keys_are() now lists all key failures in the message, not just the first one.
73
74
75 2.1.0 Mon Aug 15 19:54:27 CDT 2022
76 [ENHANCEMENTS]
77 Add diagnostic strings to the failures. For example:
78
79 assert_nonblank( [ 'foo' ], 'This should be nonblank' );
80
81 would fail with:
82
83 Assertion (This should be nonblank) failed!
84
85 but now fails with:
86
87 Assertion (This should be nonblank) failed!
88 Value is a reference to ARRAY.
89
90 Similar changes have been made to:
91 * assert_all_keys_in
92 * assert_keys_are
93 * assert_empty
94 * assert_nonempty
95
96
97 2.0.1 Fri Aug 13 11:57:15 CDT 2021
98 [FIXES]
99 assert_all_keys_in() mistakenly required a non-empty list of
100 keys to check.
101
102 [ENHANCEMENTS]
103 Sped up assert_isa_in(), assert_is().
104
105
106 2.0.0 Thu Aug 12 23:00::00 CDT 2021
107 [DIFFERENCES]
108 Now requires Perl 5.10 or higher. No longer requires Carp::Assert.
109
110 The numeric functions are more stringent now. If it expects
111 a number, then you need to pass a number. For example,
112 assert_nonnegative($x) would pass if $x was a non-numeric
113 string. Now it must be numeric.
114
115 assert_empty() and assert_nonempty() no longer gives a message
116 of "Not an array or hash reference". If you don't pass an array
117 or hash reference, the assertion will just fail with the message
118 passe3d in.
119
120 assert_aoh() and assert_datetime() no longer provide a default
121 message.
122
123 assert_in() is more strict. Each element of the target array
124 is checked to not be a reference.
125
126 assert_exists() and assert_lacks() are more strict. The list
127 of keys to check cannot be empty.
128
129 [ENHANCEMENTS]
130 Most of the functions are about twice as fast because of reduced
131 number of function calls internally.
132
133 Added assert_context_nonvoid() and assert_context_scalar()
134 to assert on how the executing function has been called.
135
136 assert_in() now lets you use undef as both the needle and one
137 of the values in the haystack.
138
139
140 1.26 Sat Dec 26 00:26:23 CST 2020
141 [ENHANCEMENTS]
142 Add assert_arrayref_nonempty().
143
144 Add assert_hashref_nonempty().
145
146 1.24 Tue Oct 6 22:37:06 CDT 2020
147 [ENHANCEMENTS]
148 The requirement for Perl 5.10 has been reverted to 5.6.1.
149
150 1.22 Tue Oct 6 22:03:55 CDT 2020
151 [ENHANCEMENTS]
152 Add assert_keys_are() for asserting an exact list of keys.
153
154 1.20 Fri Aug 9 10:10:06 CDT 2019
155 [ENHANCEMENTS]
156 Add assert_datetime() for asserting DateTime objects.
157
158 1.18 Fri Jul 19 17:12:32 CDT 2019
159 [ENHANCEMENTS]
160 Added assert_aoh() for asserting an array of hashrefs.
161
162 1.16 Fri Aug 4 14:18:51 CDT 2017
163 [ENHANCEMENTS]
164 Added the following functions:
165 * assert_numeric( $n )
166 * assert_all_keys_in( \%hash, \@keylist )
167 * assert_empty( [\%hash|\@list] )
168 * assert_coderef( $ref )
169 * assert_isa_in( $ref, \@class_list )
170 Thanks to Eric A. Zarko for some of them. The rest were migrated
171 from a private code project.
172
173 Renamed assert_listref() to assert_arrayref(), but keep
174 assert_listref() as backward compatibility. assert_listref()
175 may go away in the future.
176
177 [DOCUMENTATION]
178 Fixed a goof in the assert_integer() docs. Thanks, Randy Lauen.
179
180 1.14 Wed Oct 31 11:37:04 CDT 2012
181 [ENHANCEMENTS]
182 Added assert_undefined() for Ben Hengst.
183
184 Added assert_unlike().
185
186 [FIXES]
187 assert_nonblank() wasn't using the correct message. Thanks to
188 Leland Johnson.
189
190 assert_nonempty() wouldn't work on blessed arrays and refs.
191 Now it will.
192
193 1.12 Oct 14 2005
194 [ENHANCEMENTS]
195 * Added assert_nonnegative() and assert_nonnegative_integer().
196 * Added assert_lacks(). Thanks to Bob Diss.
197
198 1.10 Wed Feb 16 12:52:16 CST 2005
199 [FIXES]
200 * Fixed assert_positive_integer() to not pass "14.".
201
202 1.08 Wed Nov 24 11:44:34 CST 2004
203 [ENHANCEMENTS]
204 * Added assert_is() and assert_isnt()
205 * Organized the functions into logical groupings.
206
207 [INTERNALS]
208 * Now requires Test::Exception.
209 * Added t/pod.t and t/pod-coverage.t
210
211
212 1.06 Sat Oct 30 23:50:45 CDT 2004
213 * No functionality changes. Just added a Copyright notice to
214 so we can put it in Debian.
215
216 1.04 Mon Oct 18 10:21:37 CDT 2004
217 [ENHANCEMENTS]
218 * assert_isa() is now aware of subclasses.
219
220 [FIXES]
221 * $names weren't getting passed to sub-assertions. Now they are.
222
223 [DOCUMENTATION]
224 * Documentation fix.
225
226 This is the "all thanks to Allard Hoeve" release.
227
228 1.02 Tue Oct 5 17:31:56 CDT 2004
229 [ENHANCEMENTS]
230 * Added assert_hashref() and assert_listref(). Thanks to Dan
231 Friedman.
232
233 1.00 Wed Sep 22 10:14:28 CDT 2004
234 * First real official version. I'm not sure what's different
235 between this and 0.04.
236
237 * Added a bunch of new assert_* functions. Thanks David
238 Storrs and Pete Krawczyk.
239
240 0.04 August 21, 2002
241 - Added assert_integer
242 - Added assert_nonzero
243 - Added assert_nonzero_integer
244 - Added assert_exists
245
246 0.03 August 15, 2002
247 - Added assert_fail
248
249 0.02 August 8, 2002
250 - Added assert_nonblank and assert_nonref
251
252 0.01 August 8, 2002
253 - Original version, stolen from Carp::Assert