Skip to content

Commit

Permalink
better escaped JSON Pointer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 2, 2012
1 parent f9cac0b commit 5ed0573
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -713,7 +713,7 @@ C<url_for>.
my $success = $c->render('foo/index');
my $output = $c->render('foo/index', partial => 1);
This is a wrapper around L<Mojolicious::Renderer/"render">, if no template is
Render content using L<Mojolicious::Renderer/"render">, if no template is
provided a default one based on controller and action or route name will be
generated. All additional values get merged into the C<stash>.
Expand All @@ -724,7 +724,7 @@ generated. All additional values get merged into the C<stash>.
my $output = $c->render_content(header => 'Hello world!');
my $output = $c->render_content(header => sub { 'Hello world!' });
Contains partial rendered templates, used for the renderers C<layout> and
Contains partial rendered content, used for the renderers C<layout> and
C<extends> features.
=head2 C<render_data>
Expand Down
6 changes: 5 additions & 1 deletion t/mojo/json_pointer.t
Expand Up @@ -2,7 +2,7 @@ use Mojo::Base -strict;

use utf8;

use Test::More tests => 25;
use Test::More tests => 27;

# "I've had it with this school, Skinner.
# Low test scores, class after class of ugly, ugly children..."
Expand Down Expand Up @@ -45,6 +45,8 @@ is $p->get({foo => {bar => [0, undef, 3]}}, '/foo/bar/6'), undef,

# "get" (encoded)
is $p->get({'' => [0, 1]}, '/%E2%99%A5/0'), 0, '"/%E2%99%A5/0" is "0"';
is $p->get([{'^foob ar' => 'foo'}], '/0/^foob ar'), 'foo',
'"/0/^foob ar" is "foo"';
is $p->get([{'foob ar' => 'foo'}], '/0/foob%20ar'), 'foo',
'"/0/foob%20ar" is "foo"';
is $p->get([{'foo/bar' => 'bar'}], '/0/foo%2Fbar'), undef,
Expand All @@ -55,6 +57,8 @@ is $p->get([{'foo/bar/baz' => 'yada'}], '/0/foo~1bar~1baz'), 'yada',
'"/0/foo~1bar~1baz" is "yada"';
is $p->get([{'foo~/bar' => 'bar'}], '/0/foo~0~1bar'), 'bar',
'"/0/foo~0~1bar" is "bar"';
is $p->get([{'foo~/bar' => 'bar'}], '/0/foo%7E%30%7E%31bar'), 'bar',
'"/0/foo%7E%30%7E%31bar" is "bar"';
is $p->get(
[{'f~o~o~/b~' => {'a~' => {'r' => 'baz'}}}] => '/0/f~0o~0o~0~1b~0/a~0/r'),
'baz', '"/0/f~0o~0o~0~1b~0/a~0/r" is "baz"';

0 comments on commit 5ed0573

Please sign in to comment.