We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2719b53 commit 09250baCopy full SHA for 09250ba
doc/Language/testing.pod6
@@ -402,17 +402,10 @@ use Test;
402
plan 1;
403
404
sub count-chars(Str() $x) {
405
- my %chars;
406
- %chars{$_}++ for $x.comb;
407
- return %chars;
+ $x.comb.Bag
408
}
409
-my %expected =
410
- f => 1,
411
- l => 1,
412
- e => 3,
413
- c => 1,
414
- ;
415
-is-deeply count-chars('fleece'), %expected, 'count-chars works on "fleece"';
+my $expected = bag <f l e e e c>;
+is-deeply count-chars('fleece'), $expected, 'count-chars works on "fleece"';
416
=end code
417
418
B<Note:> for L<historical
0 commit comments