Skip to content

Commit 87c254f

Browse files
authored
Document is()'s special treatment of values...
that differ only on whitespace
1 parent 2f2b0f3 commit 87c254f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/Language/testing.pod6

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ L«C<is-deeply> routine|/language/testing#index-entry-is-deeply-is-deeply($value
291291
my Int $a;
292292
is $a, Int, 'The variable $a is an unassigned Int';
293293
294+
B<Note:> if I<only> whitespace differs between the values, C<is()> will output failure
295+
message differently, to show the whitespace in each values. For example, in the
296+
output below, the second test shows the literal C<\t> in the C<got:> line:
297+
298+
is "foo\tbar", "foo\tbaz"; # expected: 'foo baz'␤# got: 'foo bar'
299+
is "foo\tbar", "foo bar"; # expected: "foo bar"␤# got: "foo\tbar"
300+
294301
=item X<isnt($value, $expected, $description?)|isnt>
295302
296303
Marks a test as passed if C<$value> and C<$expected> are B<not> equal using

0 commit comments

Comments
 (0)