use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 12;
BEGIN { use_ok('Audio::Opusfile') };
my $fail = 0;
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';