@@ -215,15 +215,17 @@ X<|is,testing>
215
215
= item is($value, $expected, $description?)
216
216
217
217
Marks a test as passed if C < $value > and C < $expected > compare positively with
218
- the L < eq operator|/routine/eq > . The function accepts an optional
219
- C < $description > of the test.
218
+ the L < eq operator|/routine/eq > , unless C < $expected > is a type object, in which
219
+ case C < === > operator will be used instead; accepts an optional C < $description > of the test.
220
+
221
+ B < NOTE: > C < eq > operator the C < is() > uses stringifies,
222
+ which means C < is() > is not a good function for testing more complex things, such
223
+ as lists: C < is (1, (2, (3,))), [1, 2, 3] > passes the test, even though the operands
224
+ are vastly different. For those cases, use
225
+ L « C < is-deeply > routine|/language/testing#index-entry-is-deeply-is-deeply($value,_$expected,_$description?)»
220
226
221
227
is $pdf-document.author, "Joe", 'Retrieving the author field';
222
228
is factorial(6), 720, 'Factorial - small integer';
223
-
224
- As a special case, if C < $expected > is a type object, the comparison uses the
225
- C < === > operator instead:
226
-
227
229
my Int $a;
228
230
is $a, Int, 'The variable $a is an unassigned Int';
229
231
0 commit comments