use Fcntl qw/O_RDWR O_CREAT/;
use Getopt::Long;
use Storable qw/thaw freeze/;
+use sort 'stable';
##################################################
);
my @files;
- for (values %files) {
- my @versions = @$_;
+ for (sort keys %files) {
+ my @versions = @{$files{$_}};
my %entry = (%{$versions[0]}, formats => []);
for my $ver (@versions) {
push @{$entry{formats}}, {format => $ver->{format}, file => $ver->{file}};
BEGIN { use_ok('App::MusicExpo'); }
my $flacinfo = thaw App::MusicExpo::flacinfo 'empty.flac';
-my $mp3info = thaw App::MusicExpo::mp3info 'empty.mp3';
+my $mp3info = thaw App::MusicExpo::mp3info 'empty3.mp3';
my $vorbisinfo = thaw App::MusicExpo::vorbisinfo 'empty.ogg';
-my $mp4info = thaw App::MusicExpo::mp4info 'empty.aac';
+my $mp4info = thaw App::MusicExpo::mp4info 'empty4.aac';
is $flacinfo->{format}, 'FLAC', 'flacinfo format';
is $flacinfo->{title}, 'Cellule', 'flacinfo title';
is $mp3info->{tracknumber}, '01', 'mp3info tracknumber';
is $mp3info->{tracktotal}, '09', 'mp3info tracktotal';
is $mp3info->{genre}, 'Electro', 'mp3info genre';
-is $mp3info->{file}, 'empty.mp3', 'mp3info path';
+is $mp3info->{file}, 'empty3.mp3', 'mp3info path';
is $vorbisinfo->{format}, 'Vorbis', 'vorbisinfo format';
is $vorbisinfo->{title}, 'Cellule', 'vorbisinfo title';
is $mp4info->{tracknumber}, '1', 'mp4info tracknumber';
is $mp4info->{tracktotal}, '9', 'mp4info tracktotal';
is $mp4info->{genre}, 'Electro', 'mp4info genre';
-is $mp4info->{file}, 'empty.aac', 'mp4info path';
+is $mp4info->{file}, 'empty4.aac', 'mp4info path';
use Test::More tests => 3;
use File::Temp qw/tempfile/;
-use DB_File;
-use Storable qw/thaw/;
my $file;
BEGIN {
$file = (tempfile UNLINK => 1)[1];
- @ARGV = (-cache => $file, 'empty.flac', 'empty.mp3');
+ @ARGV = (-cache => $file, sort <empty*>);
}
BEGIN { use_ok('App::MusicExpo'); }
<thead>
<tr><th>Title<th>Artist<th>Album<th>Genre<th>Track<th>Year<th>Type
<tbody>
-<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"><a href="/music/empty.flac">FLAC</a> <a href="/music/empty.mp3">MP3</a>
+<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"><a href="/music/empty.flac">FLAC</a> <a href="/music/empty.ogg">Vorbis</a>
+<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"><a href="/music/empty3.mp3">MP3</a>
+<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">1/9<td class="year">2005<td class="formats"><a href="/music/empty4.aac">AAC</a>
</table>
OUT
ok -e $file, 'cache exists';
-tie my %db, DB_File => $file;