Skip to content

Commit f507992

Browse files
Maxim Vuetspaultcochrane
authored andcommitted
S24: Denote function names with a pair of parentheses
I think it's mostly a matter of taste whether one writes: The C<pass()> function marks a test as passed. ...or: The C<pass> function marks a test as passed. But regardless of whichever one prefers, consistency should be superior (-:
1 parent 53dfefc commit f507992

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

S24-testing.pod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ All of the following functions are exported by default:
8585
sub plan($number_of_tests) is export { ... };
8686
sub done() is export { ... };
8787

88-
In order to determine whether a test file ran all its tests, a C<plan> function
88+
In order to determine whether a test file ran all its tests, a C<plan()> function
8989
call can be made somewhere in the test file, providing a count of the total
9090
number of tests. A TAP harness can then flag an error condition when the number
9191
of tests actually run doesn't match.
9292

93-
If C<plan> isn't called, C<done> can be called at the end of the test
93+
If C<plan()> isn't called, C<done()> can be called at the end of the test
9494
file to output an automatically computed tally.
9595

96-
A TAP harness will consider it an error if neither C<plan> nor
97-
C<done> was called, or if there was more than one call in the test
96+
A TAP harness will consider it an error if neither C<plan()> nor
97+
C<done()> was called, or if there was more than one call in the test
9898
file, or if the call occurred between calling two test functions
9999
(rather than at the beginning or at the end).
100100

@@ -114,7 +114,7 @@ positional arguments to these test files by name is discouraged.
114114
sub pass($desc?) is export { ... }
115115
sub flunk($desc?) is export { ... }
116116

117-
The C<pass> function marks a test as passed. The C<flunk> function marks a
117+
The C<pass()> function marks a test as passed. The C<flunk()> function marks a
118118
test as B<not> passed.
119119

120120
=head2 diag()
@@ -161,8 +161,8 @@ condition evaluates to C<False>.
161161
sub cmp_ok(Mu $got, $op, Mu $expected, $desc?) is export { ... }
162162

163163
The C<is()> function marks a test as passed if the obtained and expected values
164-
are C<eq>: as such it is a shortcut for C<cmp_ok> with the C<'eq'> operator.
165-
The C<isnt> function marks a test as passed if the obtained and expected values
164+
are C<eq>: as such it is a shortcut for C<cmp_ok()> with the C<'eq'> operator.
165+
The C<isnt()> function marks a test as passed if the obtained and expected values
166166
are B<not> C<eq>. These are typically used to check scalar values.
167167

168168
The C<cmp_ok()> function compares two values with the given operator and passes
@@ -197,7 +197,7 @@ as a string.
197197
sub subtest(&subtests, $desc?) is export { ... }
198198

199199
The C<subtest()> function executes the given block, consisting of usually more
200-
than one test, possibly including a C<plan()> or C<done>. It will pass the
200+
than one test, possibly including a C<plan()> or C<done()>. It will pass the
201201
test only if B<all> tests in the block, pass.
202202

203203
=head2 dies_ok(), lives_ok(), throws_like()
@@ -210,7 +210,7 @@ The C<dies_ok()> passes the test if the given code throws an exception.
210210
The C<lives_ok()> passes the test if the given code B<does not> throw an
211211
exception.
212212

213-
The C<throws_like> function checks whether the given code (specified as either
213+
The C<throws_like()> function checks whether the given code (specified as either
214214
something C<Callable>, or as a something to be C<EVAL>led) throws a specific
215215
exception (either specified as a Type object, or as a string). If an
216216
exception was thrown, it will also try to match the matcher hash, in which

0 commit comments

Comments
 (0)