File: range.t

package info (click to toggle)
libmojolicious-plugin-assetpack-perl 2.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,888 kB
  • sloc: perl: 1,503; javascript: 52; makefile: 8; sh: 2
file content (22 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use lib '.';
use t::Helper;

my $t = t::Helper->t(pipes => [qw(Css Combine)]);
$t->app->asset->process;

$t->get_ok('/')->status_is(200);
my $href = $t->tx->res->dom->at('link')->{href};
ok $href, 'found link[href]';

$t->get_ok($href => {Range => 'bytes=0-2'})->status_is(206)->header_is('Accept-Ranges' => 'bytes')->content_is('.on');

$t->get_ok($href)->status_is(200)->header_is('Accept-Ranges' => 'bytes')->content_like(qr{color:});

done_testing;

__DATA__
@@ index.html.ep
%= asset 'app.css'
@@ assetpack.def
! app.css
< css-0-one.css