Skip to content

Commit

Permalink
more unicode examples and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 11, 2013
1 parent 060a775 commit 758cb7c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -114,7 +114,7 @@ surrounding text.
The colon prefix is optional for generic placeholders that are surrounded by
parentheses.

/sebastian/hello -> /(name)/hello -> {name => 'sebastian'}
/i♥mojolicious -> /(one)♥(two) -> {one => 'i', two => 'mojolicious'}

=head2 Relaxed placeholders

Expand Down
6 changes: 6 additions & 0 deletions t/mojolicious/pattern.t
Expand Up @@ -197,4 +197,10 @@ $result = $pattern->match('/footest', 1);
is_deeply $result, {'' => 'foo'}, 'right structure';
is $pattern->render($result, 1), '/footest', 'right result';

# Unicode
$pattern = Mojolicious::Routes::Pattern->new('/(one)♥(two)');
$result = $pattern->match('/i♥mojolicious');
is_deeply $result, {one => 'i', two => 'mojolicious'}, 'right structure';
is $pattern->render($result, 1), '/i♥mojolicious', 'right result';

done_testing();

0 comments on commit 758cb7c

Please sign in to comment.