Skip to content

Commit

Permalink
better range tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 20, 2012
1 parent e8084fb commit 5661a84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.59 2012-11-20
- Improved tests.

3.58 2012-11-19
- Improved documentation.
- Improved tests.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -38,7 +38,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.58';
our $VERSION = '3.59';

sub AUTOLOAD {
my $self = shift;
Expand Down
8 changes: 4 additions & 4 deletions t/mojolicious/lite_app.t
Expand Up @@ -1231,21 +1231,21 @@ $t->get_ok('/hello.txt' => {'Range' => 'bytes=2-8'})->status_is(206)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->header_is('Accept-Ranges' => 'bytes')->header_is('Content-Length' => 7)
->content_is('llo Moj');
->header_is('Content-Range: bytes 2-8/31')->content_is('llo Moj');

# GET /hello.txt (partial static file, starting at first byte)
$t->get_ok('/hello.txt' => {'Range' => 'bytes=0-8'})->status_is(206)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->header_is('Accept-Ranges' => 'bytes')->header_is('Content-Length' => 9)
->content_is('Hello Moj');
->header_is('Content-Range: bytes 0-8/31')->content_is('Hello Moj');

# GET /hello.txt (partial static file, first byte)
$t->get_ok('/hello.txt' => {'Range' => 'bytes=0-0'})->status_is(206)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->header_is('Accept-Ranges' => 'bytes')->header_is('Content-Length' => 1)
->content_is('H');
->header_is('Content-Range: bytes 0-0/31')->content_is('H');

# GET /hello3.txt (render_static and single byte file)
$t->get_ok('/hello3.txt')->status_is(200)
Expand All @@ -1259,7 +1259,7 @@ $t->get_ok('/hello3.txt' => {'Range' => 'bytes=0-0'})->status_is(206)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->header_is('Accept-Ranges' => 'bytes')->header_is('Content-Length' => 1)
->content_is('X');
->header_is('Content-Range: bytes 0-0/1')->content_is('X');

# GET /default/condition
$t->get_ok('/default/condition')->status_is(200)
Expand Down

0 comments on commit 5661a84

Please sign in to comment.