From: Marius Gavrilescu Date: Tue, 3 Sep 2013 08:04:10 +0000 (+0300) Subject: Update tests X-Git-Tag: 0.003~1 X-Git-Url: http://git.ieval.ro/?p=app-musicexpo.git;a=commitdiff_plain;h=58451f9718f96905f6f605b8447b15a451693572 Update tests --- diff --git a/MANIFEST b/MANIFEST index 3aac6cc..6b43953 100644 --- a/MANIFEST +++ b/MANIFEST @@ -9,3 +9,4 @@ lib/App/MusicExpo.pm musicexpo empty.mp3 empty.flac +empty.ogg diff --git a/empty.ogg b/empty.ogg new file mode 100644 index 0000000..62ca552 Binary files /dev/null and b/empty.ogg differ diff --git a/t/App-MusicExpo.t b/t/App-MusicExpo.t index 6dfc455..ca2c37d 100644 --- a/t/App-MusicExpo.t +++ b/t/App-MusicExpo.t @@ -2,7 +2,7 @@ use v5.14; use warnings; -use Test::More tests => 19; +use Test::More tests => 28; use Storable qw/thaw/; @@ -10,6 +10,7 @@ BEGIN { use_ok('App::MusicExpo'); } my $flacinfo = thaw App::MusicExpo::flacinfo 'empty.flac'; my $mp3info = thaw App::MusicExpo::mp3info 'empty.mp3'; +my $vorbisinfo = thaw App::MusicExpo::vorbisinfo 'empty.ogg'; is $flacinfo->{format}, 'FLAC', 'flacinfo format'; is $flacinfo->{title}, 'Cellule', 'flacinfo title'; @@ -19,7 +20,7 @@ is $flacinfo->{album}, 'L\'autre endroit', 'flacinfo album'; is $flacinfo->{tracknumber}, '01', 'flacinfo tracknumber'; is $flacinfo->{tracktotal}, '09', 'flacinfo tracktotal'; is $flacinfo->{genre}, 'Electro', 'flacinfo genre'; -is $flacinfo->{path}, '/music/empty.flac', 'flacinfo path'; +is $flacinfo->{file}, 'empty.flac', 'flacinfo path'; is $mp3info->{format}, 'MP3', 'mp3info format'; is $mp3info->{title}, 'Cellule', 'mp3info title'; @@ -29,4 +30,14 @@ is $mp3info->{album}, 'L\'autre endroit', 'mp3info album'; is $mp3info->{tracknumber}, '01', 'mp3info tracknumber'; is $mp3info->{tracktotal}, '09', 'mp3info tracktotal'; is $mp3info->{genre}, 'Electro', 'mp3info genre'; -is $mp3info->{path}, '/music/empty.mp3', 'mp3info path'; +is $mp3info->{file}, 'empty.mp3', 'mp3info path'; + +is $vorbisinfo->{format}, 'Vorbis', 'vorbisinfo format'; +is $vorbisinfo->{title}, 'Cellule', 'vorbisinfo title'; +is $vorbisinfo->{artist}, 'Silence', 'vorbisinfo artist'; +is $vorbisinfo->{year}, 2005, 'vorbisinfo year'; +is $vorbisinfo->{album}, 'L\'autre endroit', 'vorbisinfo album'; +is $vorbisinfo->{tracknumber}, '01', 'vorbisinfo tracknumber'; +is $vorbisinfo->{tracktotal}, '09', 'vorbisinfo tracktotal'; +is $vorbisinfo->{genre}, 'Electro', 'vorbisinfo genre'; +is $vorbisinfo->{file}, 'empty.ogg', 'vorbisinfo path'; diff --git a/t/musicexpo-cache.t b/t/musicexpo-cache.t index 21f5d99..1f464ed 100644 --- a/t/musicexpo-cache.t +++ b/t/musicexpo-cache.t @@ -32,8 +32,7 @@ is $out, <<'OUT', 'output is correct'; TitleArtistAlbumGenreTrackYearType -CelluleSilenceL'autre endroitElectro01/092005FLAC -CelluleSilenceL'autre endroitElectro01/092005MP3 +SilenceL'autre endroitElectro01/092005FLAC MP3 OUT