Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
even more escaping tests
  • Loading branch information
kraih committed May 5, 2012
1 parent fef72eb commit 6c7ad98
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions t/mojo/bytestream.t
Expand Up @@ -5,7 +5,7 @@ use utf8;
# "Homer, we're going to ask you a few simple yes or no questions.
# Do you understand?
# Yes. *lie dectector blows up*"
use Test::More tests => 145;
use Test::More tests => 146;

# Need to be loaded first to trigger edge case
use MIME::Base64;
Expand Down Expand Up @@ -82,6 +82,10 @@ is $stream->url_escape, 'business%3B23', 'right url escaped result';
$stream = b('&business;23')->url_escape('s&');
is "$stream", '%26bu%73ine%73%73;23', 'right url escaped result';

# url_escape (nothing to escape)
$stream = b('foobar123-._~')->url_escape;
is "$stream", 'foobar123-._~', 'right url escaped result';

# url_unescape
$stream = b('business%3B23');
is $stream->url_unescape, 'business;23', 'right url unescaped result';
Expand Down Expand Up @@ -198,8 +202,9 @@ $stream = b("foo bar'<baz>");
is $stream->html_escape, 'foo bar&#39;&LTbaz&GT', 'right html escaped result';

# html_escape (nothing to escape)
$stream = b('foobar');
is $stream->html_escape, 'foobar', 'right html escaped result';
$stream = b("foobar123\n\r\t !#\$\%()*+,-./:;=?[\\]^-{|}@~");
is $stream->html_escape, "foobar123\n\r\t !#\$\%()*+,-./:;=?[\\]^-{|}@~",
'right html escaped result';

# html_unescape
$stream = b('&#x3c;foo&#x3E;bar&lt;baz&gt;&#x26;&#34;');
Expand Down

0 comments on commit 6c7ad98

Please sign in to comment.