Navigation Menu

Skip to content

Commit

Permalink
make sure the parsed template has been consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 7, 2015
1 parent e60aa74 commit 8f98c9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

5.78 2015-02-06
5.78 2015-02-07
- Improved design of built-in templates.
- Fixed warnings in Mojo::URL.

Expand Down
1 change: 1 addition & 0 deletions t/mojo/template.t
Expand Up @@ -1026,6 +1026,7 @@ test
EOF
is $mt->tree->[0][1], "test\n123\n456", 'optimized text lines';
$output = $mt->build->compile || $mt->interpret;
is_deeply $mt->tree, [], 'has been consumed';
is $output, "test\n123\n456789\\\n987\n654\n321\n", 'just text';

# Scoped scalar
Expand Down
3 changes: 2 additions & 1 deletion t/mojolicious/pattern.t
Expand Up @@ -11,7 +11,8 @@ is_deeply $pattern->match('/test'), undef, 'no result';
is $pattern->tree->[0][1], '/test/123', 'optimized pattern';

# Normal pattern with text, placeholders and a default value
$pattern = Mojolicious::Routes::Pattern->new('/test/(controller)/:action');
$pattern
= Mojolicious::Routes::Pattern->new->parse('/test/(controller)/:action');
$pattern->defaults({action => 'index'});
is_deeply $pattern->match('/test/foo/bar', 1),
{controller => 'foo', action => 'bar'}, 'right structure';
Expand Down

0 comments on commit 8f98c9c

Please sign in to comment.