X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2Fmusicexpo-cache.t;h=6ed30460d779a905ff9dd5bbe29575799d080081;hb=4ffde4cd97c6cd4f941d485ee7381621f3a38fe2;hp=70972a1b8882b34106254376eb2d6003a487b06e;hpb=9d6d04a4bf7fc26eb7ea4361c8c726ad24106871;p=app-musicexpo.git diff --git a/t/musicexpo-cache.t b/t/musicexpo-cache.t index 70972a1..6ed3046 100644 --- a/t/musicexpo-cache.t +++ b/t/musicexpo-cache.t @@ -1,18 +1,16 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -w use v5.14; use warnings; 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 ); } BEGIN { use_ok('App::MusicExpo'); } @@ -20,23 +18,41 @@ close STDOUT; my $out; open STDOUT, '>', \$out; +my %handled = map { $_ => 1 } App::MusicExpo::extensions_handled; + +my $prefix = 'CelluleSilenceL'autre endroitElectro01/092005'; + +my @lines; +if ($handled{'.flac'} && $handled{'.ogg'}) { + push @lines, $prefix . 'FLAC Vorbis ' +} elsif ($handled{'.flac'}) { + push @lines, $prefix . 'FLAC ' +} elsif ($handled{'.ogg'}) { + push @lines, $prefix . 'Vorbis ' +} + +push @lines, $prefix . 'Opus ' if $handled{'.opus'}; +push @lines, $prefix . 'MP3 ' if $handled{'.mp3'}; +push @lines, 'L'autre endroitElectro1/92005AAC ' if $handled{'.aac'}; + +my $contents = join '', map { "\n$_" } @lines; + App::MusicExpo->run; -is $out, <<'OUT', 'output is correct'; +is $out, <<"OUT", 'output is correct'; Music - + + + +
-$contents
TitleArtistAlbumGenreTrackYearType -
CelluleSilenceL'autre endroitElectro01/092005FLAC MP3 +
- - OUT ok -e $file, 'cache exists'; -tie my %db, DB_File => $file;