Skip to content

Commit

Permalink
use a more defensive steady_time test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 21, 2014
1 parent 34e5df1 commit 50164ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -72,7 +72,7 @@ will learn more about this later on. Internally routes get compiled to regular
expressions, so you can get the best of both worlds with a little bit of
experience.

/user/show/:id -> qr/(?-xism:^\/user\/show/([^\/\.]+))/
/user/show/:id -> qr/(?-xism:^\/user\/show/([^\/.]+))/

A trailing slash in the path is always optional.

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Routes/Pattern.pm
Expand Up @@ -116,7 +116,7 @@ sub _compile {
unshift @$placeholders, $value;

# Placeholder
if ($op eq 'placeholder') { $fragment = '([^/\.]+)' }
if ($op eq 'placeholder') { $fragment = '([^/.]+)' }

# Relaxed
elsif ($op eq 'relaxed') { $fragment = '([^/]+)' }
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/util.t
Expand Up @@ -386,7 +386,7 @@ spurt "just\nworks!", $file;
is slurp($file), "just\nworks!", 'successful roundtrip';

# steady_time
like steady_time, qr/^\d+\.\d+$/, 'high resolution time';
like steady_time, qr/^[\d.]+$/, 'high resolution time';

# monkey_patch
{
Expand Down

0 comments on commit 50164ba

Please sign in to comment.