X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2FAudio-Opusfile.t;fp=t%2FAudio-Opusfile.t;h=ca00190215381a890161e0211bd97cd0f1608957;hb=5fbea9a258070b0c9e770e80aa52d17d66730d44;hp=5e8c7ee77a78fd7e7d37a0ea4c7c04c9effcd817;hpb=74630599cbd740ae41a7573fd64fb5c98c1c5df0;p=audio-opusfile.git diff --git a/t/Audio-Opusfile.t b/t/Audio-Opusfile.t index 5e8c7ee..ca00190 100644 --- a/t/Audio-Opusfile.t +++ b/t/Audio-Opusfile.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 12; BEGIN { use_ok('Audio::Opusfile') }; my $fail = 0; @@ -29,7 +29,21 @@ foreach my $constname (qw( ok( $fail == 0 , 'Constants' ); my $of = Audio::Opusfile->new_from_file('empty.opus'); +ok $of->seekable, 'seekable'; +is $of->link_count, 1, 'link_count'; +is $of->serialno(0), 1745145935, 'serialno, arg=0'; +is $of->serialno(200), 1745145935, 'serialno, arg=200'; +is $of->serialno, 1745145935, 'serialno, no arg'; my $tags = $of->tags; is $tags->query_count('TITLE'), 1, 'query_count'; is $tags->query('TITLE'), 'Cellule', 'query'; is_deeply [$tags->query_all('TITLE')], ['Cellule'], 'query_all'; + +open my $fh, '<', 'empty.opus'; +read $fh, my $buf, 100; +ok Audio::Opusfile::test($buf), 'test'; + +seek $fh, 0, 0; +read $fh, $buf, 20000; +$of = Audio::Opusfile->new_from_memory($buf); +is $of->tags->query('TITLE'), 'Cellule', 'new_from_memory + query';