Skip to content

Commit

Permalink
Fixed typos and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
thundergnat committed Nov 16, 2010
1 parent 9b666f0 commit 0417c5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/Sort/Naturally.pm6
Expand Up @@ -17,9 +17,9 @@ sub naturally ($a) is export(:standard) {

sub p5naturally ($a) is export(:p5) {
$a.lc.subst(/^(\d+)/, -> $/ { 0 ~ $0.chars.chr ~ $0 } )\
# Less than awesome use of captures, but rakudo doesn't have <?after ...>
# lookaround implemented yet. Really should be:
# .subst(/<?after \D>(\d+)/, -> $/ { 'z{' ~ $0.chars.chr ~ $0 }, :g)
.subst(/(\D)(\d+)/, -> $/ { $0 ~ 'z{' ~ $1.chars.chr ~ $1 }, :g)
~ "\x0" ~ $a
# Less than awesome use of captures, but rakudo doesn't have <?after ...>
# lookaround implemented yet. Really should be:
# .subst(/<?after \D>(\d+)/, -> $/ { 'z{' ~ $0.chars.chr ~ $0 }, :g)
.subst(/(\D)(\d+)/, -> $/ { $0 ~ 'z{' ~ $1.chars.chr ~ $1 }, :g)
~ "\x0" ~ $a
}
4 changes: 2 additions & 2 deletions t/01-basic.t
Expand Up @@ -8,7 +8,7 @@ plan 12;
my @test;
my $nsorted = '';

# does it deal with empty array in a sane fashhion?
# does it deal with empty array in a sane fashion?
is(~@test.sort( { .&naturally } ), $nsorted,
"calling &naturally in a sort block on an empty array is ok");
is(~@test.nsort, $nsorted,
Expand All @@ -19,7 +19,7 @@ is(~@test.sort( { $^a ncmp $^b } ), $nsorted,
"calling ncmp in a sort block on an empty array is ok");


# does it return the terms in the expected oorder?
# does it return the terms in the expected order?
@test = <2 210 21 30 3rd d1 d10 D2 D21 d3 aid Are any ANY 1 Any 11 100 14th>;
$nsorted = '1 2 3rd 11 14th 21 30 100 210 aid ANY Any any Are d1 D2 d3 d10 D21';

Expand Down

0 comments on commit 0417c5b

Please sign in to comment.