]>
iEval git - app-musicexpo.git/blob - t/musicexpo-cache.t
6ed30460d779a905ff9dd5bbe29575799d080081
5 use Test
::More tests
=> 3;
7 use File
::Temp qw
/tempfile/;
12 $file = (tempfile UNLINK
=> 1)[1];
13 @ARGV = (-cache
=> $file, sort <empty
*>);
15 BEGIN { use_ok
('App::MusicExpo'); }
19 open STDOUT
, '>', \
$out;
21 my %handled = map { $_ => 1 } App
::MusicExpo
::extensions_handled
;
23 my $prefix = '<tr><td class="title"><a href="#silence-cellule" data-hash="#silence-cellule">Cellule</a><td class="artist">Silence<td class="album">L'autre endroit<td class="genre">Electro<td class="track">01/09<td class="year">2005<td class="formats">';
26 if ($handled{'.flac'} && $handled{'.ogg'}) {
27 push @lines, $prefix . '<a href="/music/empty.flac">FLAC</a> <a href="/music/empty.ogg">Vorbis</a> '
28 } elsif ($handled{'.flac'}) {
29 push @lines, $prefix . '<a href="/music/empty.flac">FLAC</a> '
30 } elsif ($handled{'.ogg'}) {
31 push @lines, $prefix . '<a href="/music/empty.ogg">Vorbis</a> '
34 push @lines, $prefix . '<a href="/music/empty2.opus">Opus</a> ' if $handled{'.opus'};
35 push @lines, $prefix . '<a href="/music/empty3.mp3">MP3</a> ' if $handled{'.mp3'};
36 push @lines, '<td class="album">L'autre endroit<td class="genre">Electro<td class="track">1/9<td class="year">2005<td class="formats"><a href="/music/empty4.aac">AAC</a> ' if $handled{'.aac'};
38 my $contents = join '', map { "\n$_" } @lines;
42 is
$out, <<"OUT", 'output is correct';
45 <meta charset="utf-8">
46 <link rel="stylesheet" href="musicexpo.css">
47 <script async defer type="application/javascript" src="player.js"></script>
49 <div id="player"></div>
53 <tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
58 ok
-e
$file, 'cache exists';
This page took 0.055433 seconds and 4 git commands to generate.