Debian Codegraph @

upstream/debian-unstable/man3/Test2::Tools::Tiny.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (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 .\"
57 .IX Title "Test2::Tools::Tiny 3perl"
58 .TH Test2::Tools::Tiny 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 Test2::Tools::Tiny \- Tiny set of tools for unfortunate souls who cannot use
65 Test2::Suite.
66 .SH DESCRIPTION
67 .IX Header "DESCRIPTION"
68 You should really look at Test2::Suite. This package is some very basic
69 essential tools implemented using Test2. This exists only so that Test2
70 and other tools required by Test2::Suite can be tested. This is the package
71 Test2 uses to test itself.
72 .SH "USE Test2::Suite INSTEAD"
73 .IX Header "USE Test2::Suite INSTEAD"
74 Use Test2::Suite if at all possible.
75 .SH EXPORTS
76 .IX Header "EXPORTS"
77 .ie n .IP "ok($bool, $name)" 4
78 .el .IP "ok($bool, \f(CW$name\fR)" 4
79 .IX Item "ok($bool, $name)"
80 .PD 0
81 .ie n .IP "ok($bool, $name, @diag)" 4
82 .el .IP "ok($bool, \f(CW$name\fR, \f(CW@diag\fR)" 4
83 .IX Item "ok($bool, $name, @diag)"
84 .PD
85 Run a simple assertion.
86 .ie n .IP "is($got, $want, $name)" 4
87 .el .IP "is($got, \f(CW$want\fR, \f(CW$name\fR)" 4
88 .IX Item "is($got, $want, $name)"
89 .PD 0
90 .ie n .IP "is($got, $want, $name, @diag)" 4
91 .el .IP "is($got, \f(CW$want\fR, \f(CW$name\fR, \f(CW@diag\fR)" 4
92 .IX Item "is($got, $want, $name, @diag)"
93 .PD
94 Assert that 2 strings are the same.
95 .ie n .IP "isnt($got, $do_not_want, $name)" 4
96 .el .IP "isnt($got, \f(CW$do_not_want\fR, \f(CW$name\fR)" 4
97 .IX Item "isnt($got, $do_not_want, $name)"
98 .PD 0
99 .ie n .IP "isnt($got, $do_not_want, $name, @diag)" 4
100 .el .IP "isnt($got, \f(CW$do_not_want\fR, \f(CW$name\fR, \f(CW@diag\fR)" 4
101 .IX Item "isnt($got, $do_not_want, $name, @diag)"
102 .PD
103 Assert that 2 strings are not the same.
104 .ie n .IP "like($got, $regex, $name)" 4
105 .el .IP "like($got, \f(CW$regex\fR, \f(CW$name\fR)" 4
106 .IX Item "like($got, $regex, $name)"
107 .PD 0
108 .ie n .IP "like($got, $regex, $name, @diag)" 4
109 .el .IP "like($got, \f(CW$regex\fR, \f(CW$name\fR, \f(CW@diag\fR)" 4
110 .IX Item "like($got, $regex, $name, @diag)"
111 .PD
112 Check that the input string matches the regex.
113 .ie n .IP "unlike($got, $regex, $name)" 4
114 .el .IP "unlike($got, \f(CW$regex\fR, \f(CW$name\fR)" 4
115 .IX Item "unlike($got, $regex, $name)"
116 .PD 0
117 .ie n .IP "unlike($got, $regex, $name, @diag)" 4
118 .el .IP "unlike($got, \f(CW$regex\fR, \f(CW$name\fR, \f(CW@diag\fR)" 4
119 .IX Item "unlike($got, $regex, $name, @diag)"
120 .PD
121 Check that the input string does not match the regex.
122 .ie n .IP "is_deeply($got, $want, $name)" 4
123 .el .IP "is_deeply($got, \f(CW$want\fR, \f(CW$name\fR)" 4
124 .IX Item "is_deeply($got, $want, $name)"
125 .PD 0
126 .ie n .IP "is_deeply($got, $want, $name, @diag)" 4
127 .el .IP "is_deeply($got, \f(CW$want\fR, \f(CW$name\fR, \f(CW@diag\fR)" 4
128 .IX Item "is_deeply($got, $want, $name, @diag)"
129 .PD
130 Check 2 data structures. Please note that this is a \fIDUMB\fR implementation that
131 compares the output of Data::Dumper against both structures.
132 .IP diag($msg) 4
133 .IX Item "diag($msg)"
134 Issue a diagnostics message to STDERR.
135 .IP note($msg) 4
136 .IX Item "note($msg)"
137 Issue a diagnostics message to STDOUT.
138 .IP skip_all($reason) 4
139 .IX Item "skip_all($reason)"
140 Skip all tests.
141 .ie n .IP "todo $reason => sub { ... }" 4
142 .el .IP "todo \f(CW$reason\fR => sub { ... }" 4
143 .IX Item "todo $reason => sub { ... }"
144 Run a block in TODO mode.
145 .IP plan($count) 4
146 .IX Item "plan($count)"
147 Set the plan.
148 .IP \fBdone_testing()\fR 4
149 .IX Item "done_testing()"
150 Set the plan to the current test count.
151 .ie n .IP "$warnings = warnings { ... }" 4
152 .el .IP "\f(CW$warnings\fR = warnings { ... }" 4
153 .IX Item "$warnings = warnings { ... }"
154 Capture an arrayref of warnings from the block.
155 .ie n .IP "$exception = exception { ... }" 4
156 .el .IP "\f(CW$exception\fR = exception { ... }" 4
157 .IX Item "$exception = exception { ... }"
158 Capture an exception.
159 .ie n .IP "tests $name => sub { ... }" 4
160 .el .IP "tests \f(CW$name\fR => sub { ... }" 4
161 .IX Item "tests $name => sub { ... }"
162 Run a subtest.
163 .ie n .IP "$output = capture { ... }" 4
164 .el .IP "\f(CW$output\fR = capture { ... }" 4
165 .IX Item "$output = capture { ... }"
166 Capture STDOUT and STDERR output.
167 .Sp
168 Result looks like this:
169 .Sp
170 .Vb 4
171 \& {
172 \& STDOUT => "...",
173 \& STDERR => "...",
174 \& }
175 .Ve
176 .SH SOURCE
177 .IX Header "SOURCE"
178 The source code repository for Test2 can be found at
179 <https://github.com/Test\-More/test\-more/>.
180 .SH MAINTAINERS
181 .IX Header "MAINTAINERS"
182 .IP "Chad Granum <[email protected]>" 4
183 .IX Item "Chad Granum <[email protected]>"
184 .SH AUTHORS
185 .IX Header "AUTHORS"
186 .PD 0
187 .IP "Chad Granum <[email protected]>" 4
188 .IX Item "Chad Granum <[email protected]>"
189 .PD
190 .SH COPYRIGHT
191 .IX Header "COPYRIGHT"
192 Copyright 2020 Chad Granum <[email protected]>.
193 .PP
194 This program is free software; you can redistribute it and/or
195 modify it under the same terms as Perl itself.
196 .PP
197 See <https://dev.perl.org/licenses/>