Skip to content

Commit

Permalink
Use shiny regex classes in example
Browse files Browse the repository at this point in the history
Totally forgot we have these. (also fix a bug in letters regex)
  • Loading branch information
zoffixznet committed May 17, 2017
1 parent 6cdbe86 commit 6ff19e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/Language/testing.pod6
Expand Up @@ -405,15 +405,15 @@ sub string-info(Str() $_) {
Map.new: (
length => .chars,
char-counts => Bag.new-from-pairs: (
letters => +.comb(/<[\w]-[_]>/),
digits => +.comb(/\d/),
other => +.comb(/<.-[\w\d]+[_]>/),
letters => +.comb(/<:letter>/),
digits => +.comb(/<:digit>/),
other => +.comb(/<.-:letter-:digit>/),
))
}
is-deeply string-info('I ♥ Perl 6'), Map.new((
:10length,
char-counts => Bag.new-from-pairs: ( :6letters, :1digits, :4other, )
char-counts => Bag.new-from-pairs: ( :5letters, :1digits, :4other, )
)), 'string-info gives right info';
=end code
Expand Down

0 comments on commit 6ff19e6

Please sign in to comment.