More functions
[audio-opusfile.git] / t / Audio-Opusfile.t
index 5e8c7ee77a78fd7e7d37a0ea4c7c04c9effcd817..ca00190215381a890161e0211bd97cd0f1608957 100644 (file)
@@ -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';
This page took 0.009599 seconds and 4 git commands to generate.