Debian Codegraph @

upstream/mageia-cauldron/man3pm/Test2::Bundle::More.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Test2::Bundle::More 3pm"
61 .TH Test2::Bundle::More 3pm 2025-06-24 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Test2::Bundle::More \- ALMOST a drop\-in replacement for Test::More.
68 .SH DESCRIPTION
69 .IX Header "DESCRIPTION"
70 This bundle is intended to be a (mostly) drop\-in replacement for
71 Test::More. See "KEY DIFFERENCES FROM Test::More" for details.
72 .SH SYNOPSIS
73 .IX Header "SYNOPSIS"
74 .Vb 1
75 \& use Test2::Bundle::More;
76 \&
77 \& ok(1, "pass");
78 \&
79 \& ...
80 \&
81 \& done_testing;
82 .Ve
83 .SH PLUGINS
84 .IX Header "PLUGINS"
85 This loads Test2::Plugin::ExitSummary.
86 .SH TOOLS
87 .IX Header "TOOLS"
88 These are from Test2::Tools::Basic. See Test2::Tools::Basic for details.
89 .ie n .IP "ok($bool, $name)" 4
90 .el .IP "ok($bool, \f(CW$name\fR)" 4
91 .IX Item "ok($bool, $name)"
92 .PD 0
93 .IP pass($name) 4
94 .IX Item "pass($name)"
95 .IP fail($name) 4
96 .IX Item "fail($name)"
97 .ie n .IP "skip($why, $count)" 4
98 .el .IP "skip($why, \f(CW$count\fR)" 4
99 .IX Item "skip($why, $count)"
100 .ie n .IP "$todo = todo($why)" 4
101 .el .IP "\f(CW$todo\fR = todo($why)" 4
102 .IX Item "$todo = todo($why)"
103 .IP diag($message) 4
104 .IX Item "diag($message)"
105 .IP note($message) 4
106 .IX Item "note($message)"
107 .IP plan($count) 4
108 .IX Item "plan($count)"
109 .IP skip_all($why) 4
110 .IX Item "skip_all($why)"
111 .IP \fBdone_testing()\fR 4
112 .IX Item "done_testing()"
113 .IP BAIL_OUT($why) 4
114 .IX Item "BAIL_OUT($why)"
115 .PD
116 .PP
117 These are from Test2::Tools::ClassicCompare. See
118 Test2::Tools::ClassicCompare for details.
119 .ie n .IP "is($got, $want, $name)" 4
120 .el .IP "is($got, \f(CW$want\fR, \f(CW$name\fR)" 4
121 .IX Item "is($got, $want, $name)"
122 .PD 0
123 .ie n .IP "isnt($got, $donotwant, $name)" 4
124 .el .IP "isnt($got, \f(CW$donotwant\fR, \f(CW$name\fR)" 4
125 .IX Item "isnt($got, $donotwant, $name)"
126 .ie n .IP "like($got, qr/match/, $name)" 4
127 .el .IP "like($got, qr/match/, \f(CW$name\fR)" 4
128 .IX Item "like($got, qr/match/, $name)"
129 .ie n .IP "unlike($got, qr/mismatch/, $name)" 4
130 .el .IP "unlike($got, qr/mismatch/, \f(CW$name\fR)" 4
131 .IX Item "unlike($got, qr/mismatch/, $name)"
132 .ie n .IP "is_deeply($got, $want, ""Deep compare"")" 4
133 .el .IP "is_deeply($got, \f(CW$want\fR, ""Deep compare"")" 4
134 .IX Item "is_deeply($got, $want, ""Deep compare"")"
135 .ie n .IP "cmp_ok($got, $op, $want, $name)" 4
136 .el .IP "cmp_ok($got, \f(CW$op\fR, \f(CW$want\fR, \f(CW$name\fR)" 4
137 .IX Item "cmp_ok($got, $op, $want, $name)"
138 .PD
139 .PP
140 These are from Test2::Tools::Class. See Test2::Tools::Class for details.
141 .ie n .IP "isa_ok($thing, @classes)" 4
142 .el .IP "isa_ok($thing, \f(CW@classes\fR)" 4
143 .IX Item "isa_ok($thing, @classes)"
144 .PD 0
145 .ie n .IP "can_ok($thing, @subs)" 4
146 .el .IP "can_ok($thing, \f(CW@subs\fR)" 4
147 .IX Item "can_ok($thing, @subs)"
148 .PD
149 .PP
150 This is from Test2::Tools::Subtest. It is called \f(CWsubtest_streamed()\fR in
151 that package.
152 .ie n .IP "subtest $name => sub { ... }" 4
153 .el .IP "subtest \f(CW$name\fR => sub { ... }" 4
154 .IX Item "subtest $name => sub { ... }"
155 .SH "KEY DIFFERENCES FROM Test::More"
156 .IX Header "KEY DIFFERENCES FROM Test::More"
157 .IP "You cannot plan at import." 4
158 .IX Item "You cannot plan at import."
159 THIS WILL \fBNOT\fR WORK:
160 .Sp
161 .Vb 1
162 \& use Test2::Bundle::More tests => 5;
163 .Ve
164 .Sp
165 Instead you must plan in a separate statement:
166 .Sp
167 .Vb 2
168 \& use Test2::Bundle::More;
169 \& plan 5;
170 .Ve
171 .IP "You have three subs imported for use in planning" 4
172 .IX Item "You have three subs imported for use in planning"
173 Use \f(CWplan($count)\fR, \f(CWskip_all($reason)\fR, or \f(CWdone_testing()\fR for your
174 planning.
175 .IP "isa_ok accepts different arguments" 4
176 .IX Item "isa_ok accepts different arguments"
177 \&\f(CW\*(C`isa_ok\*(C'\fR in Test::More was:
178 .Sp
179 .Vb 1
180 \& isa_ok($thing, $isa, $alt_thing_name);
181 .Ve
182 .Sp
183 This was very inconsistent with tools like \f(CW\*(C`can_ok($thing, @subs)\*(C'\fR.
184 .Sp
185 In Test2::Bundle::More, \f(CWisa_ok()\fR takes a \f(CW$thing\fR and a list of \f(CW@isa\fR.
186 .Sp
187 .Vb 1
188 \& isa_ok($thing, $class1, $class2, ...);
189 .Ve
190 .SS "THESE FUNCTIONS AND VARIABLES HAVE BEEN REMOVED"
191 .IX Subsection "THESE FUNCTIONS AND VARIABLES HAVE BEEN REMOVED"
192 .ie n .IP $TODO 4
193 .el .IP \f(CW$TODO\fR 4
194 .IX Item "$TODO"
195 See \f(CWtodo()\fR.
196 .IP \fBuse_ok()\fR 4
197 .IX Item "use_ok()"
198 .PD 0
199 .IP \fBrequire_ok()\fR 4
200 .IX Item "require_ok()"
201 .PD
202 These are not necessary. Use \f(CW\*(C`use\*(C'\fR and \f(CW\*(C`require\*(C'\fR directly. If there is an
203 error loading the module the test will catch the error and fail.
204 .IP \fBtodo_skip()\fR 4
205 .IX Item "todo_skip()"
206 Not necessary.
207 .IP \fBeq_array()\fR 4
208 .IX Item "eq_array()"
209 .PD 0
210 .IP \fBeq_hash()\fR 4
211 .IX Item "eq_hash()"
212 .IP \fBeq_set()\fR 4
213 .IX Item "eq_set()"
214 .PD
215 Discouraged in Test::More.
216 .IP \fBexplain()\fR 4
217 .IX Item "explain()"
218 This started a fight between Test developers, who may now each write their own
219 implementations in Test2. (See explain in Test::Most vs Test::More.
220 Hint: Test::Most wrote it first, then Test::More added it, but broke
221 compatibility).
222 .IP \fBnew_ok()\fR 4
223 .IX Item "new_ok()"
224 Not necessary.
225 .SH SOURCE
226 .IX Header "SOURCE"
227 The source code repository for Test2\-Suite can be found at
228 \&\fIhttps://github.com/Test\-More/test\-more/\fR.
229 .SH MAINTAINERS
230 .IX Header "MAINTAINERS"
231 .IP "Chad Granum <[email protected]>" 4
232 .IX Item "Chad Granum <[email protected]>"
233 .SH AUTHORS
234 .IX Header "AUTHORS"
235 .IP "Chad Granum <[email protected]>" 4
236 .IX Item "Chad Granum <[email protected]>"
237 .SH COPYRIGHT
238 .IX Header "COPYRIGHT"
239 Copyright Chad Granum <[email protected]>.
240 .PP
241 This program is free software; you can redistribute it and/or
242 modify it under the same terms as Perl itself.
243 .PP
244 See \fIhttp://dev.perl.org/licenses/\fR