X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Futf_incoming.t;h=7a0d94d95b1c1b7d9281d93af0401de89aca9b6e;hp=a06338d9ba3c9311271071560056343afe605d7b;hb=4a64c27b130d781382e4c4f8c57bab11ea2f7d88;hpb=7b39dea14ca0d7fdd024a070e6221545c7635943 diff --git a/t/utf_incoming.t b/t/utf_incoming.t index a06338d..7a0d94d 100644 --- a/t/utf_incoming.t +++ b/t/utf_incoming.t @@ -114,6 +114,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is path-heart action ♥

', 'correct body'; is $res->content_length, 36, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -122,6 +123,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is path-heart-arg action ♥

', 'correct body'; is $res->content_length, 40, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -130,6 +132,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is path-hat action ^

', 'correct body'; is $res->content_length, 32, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -138,6 +141,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is base-link action ♥

', 'correct body'; is $res->content_length, 35, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -152,6 +156,7 @@ use Catalyst::Test 'MyApp'; is $c->req->parameters->{'♥'}[0], '♥'; is $c->req->parameters->{a}, 1; is $c->req->body_parameters->{a}, 1; + is $res->content_charset, 'UTF-8'; } { @@ -161,6 +166,7 @@ use Catalyst::Test 'MyApp'; is decode_utf8($res->content), '

This is base-link action ♥

', 'correct body'; is $res->content_length, 35, 'correct length'; is $c->req->query_keywords, '♥♥♥'; + is $res->content_charset, 'UTF-8'; } { @@ -169,6 +175,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is base-link action ♥ ♥

', 'correct body'; is $res->content_length, 39, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -176,6 +183,7 @@ use Catalyst::Test 'MyApp'; is decode_utf8($res->content), '

This is base-link action ♥ ♥

', 'correct body'; is $res->content_length, 39, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -192,6 +200,8 @@ use Catalyst::Test 'MyApp'; is $c->req->query_parameters->{'♥'}, '♥♥'; is $c->req->body_parameters->{'♥'}, '♥♥'; is $c->req->parameters->{'♥'}[0], '♥♥'; #combined with query and body + is $res->content_charset, 'UTF-8'; + } } @@ -203,6 +213,7 @@ use Catalyst::Test 'MyApp'; is decode_utf8($res->content), "$url", 'correct body'; #should do nothing is $res->content, "$url", 'correct body'; is $res->content_length, 90, 'correct length'; + is $res->content_charset, 'UTF-8'; } { @@ -210,6 +221,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is stream_write action ♥

', 'correct body'; + is $res->content_charset, 'UTF-8'; } { @@ -217,6 +229,7 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), "

This is stream_body_fh action ♥

\n", 'correct body'; + is $res->content_charset, 'UTF-8'; # Not sure why there is a trailing newline above... its not in catalyst code I can see. Not sure # if is a problem or just an artifact of the why the test stuff works - JNAP } @@ -226,7 +239,10 @@ use Catalyst::Test 'MyApp'; is $res->code, 200, 'OK'; is decode_utf8($res->content), '

This is stream_write_fh action ♥

', 'correct body'; + is $res->content_length, 41, 'correct length'; + is $res->content_charset, 'UTF-8'; } - done_testing; + +MyApp->to_app;