@@ -171,22 +171,30 @@ a test as passed if the given condition evaluates to C<False>.
171
171
172
172
= item is($obtained, $expected, $description?)
173
173
174
- Marks a test as passed if the C < $obtained > and C < $expected > values are equal
175
- when coerced to strings (i.e., they compare as equal when using the
176
- L < eq operator|/routine/eq > ). The function
174
+ Marks a test as passed if the C < $obtained > and C < $expected > values are equal.
175
+ If C < $expected > is a type object, then the comparison operator is C < === > .
176
+ If C < $expected > is defined, then C < $obtained > and C < $expected > are coerced
177
+ to strings and compared using the L < eq operator|/routine/eq > ). The function
177
178
accepts an optional C < $description > of the test.
178
179
179
180
my $pi = 3;
180
181
is($pi, 3, 'The variable $pi equals 3');
181
182
183
+ my Int $a;
184
+ is $a, Int, 'The variable $a is an unassigned Int';
185
+
182
186
= item isnt($obtained, $expected, $description?)
183
187
184
188
Marks a test as passed if the C < $obtained > and C < $expected > values are
185
- B < not > equal (i.e., they compare as B < not > equal when using the C < 'eq' >
186
- operator). The function accepts an optional C < $description > of the test.
189
+ B < not > equal using the same rules as C < is() > . The function accepts an
190
+ optional C < $description > of the test.
187
191
188
192
isnt(pi, 3, 'The constant π is not equal to 3');
189
193
194
+ my Int $a = 23;
195
+ $a = Nil;
196
+ isnt $a, Nil, 'Nil should not survive being put in a container';
197
+
190
198
= item cmp_ok($obtained, $comparison, $expected, $description?)
191
199
192
200
The C < cmp_ok() > function compares the C < $obtained > and C < $expected > values
0 commit comments