File: route.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 (19 lines) | stat: -rw-r--r-- 487 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
use lib '.';
use t::Helper;

my $t = t::Helper->t(pipes => ['Css']);
is_deeply([sort { length $a <=> length $b } routes()], ['/'], 'one route');

$t->app->asset->process('app.css' => 'one.css');
is_deeply([sort { length $a <=> length $b } routes()], ['/', '/asset/:checksum/*name'], 'two routes');

done_testing;

sub routes {
  my $r = shift || $t->app->routes;
  return map { (($_->pattern->unparsed || '/'), routes($_)) } @{$r->children};
}

__DATA__
@@ one.css
.one { color: #000; }