Add Audio::Opusfile::Head
[audio-opusfile.git] / t / Audio-Opusfile.t
index ca00190215381a890161e0211bd97cd0f1608957..8ef7793f4a08c3f770f84ebc5257684fdeee0ebd 100644 (file)
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More tests => 23;
 BEGIN { use_ok('Audio::Opusfile') };
 
 my $fail = 0;
@@ -34,6 +34,21 @@ 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 $head = $of->head;
+is $head->version, 1, 'head->version';
+is $head->channel_count, 2, 'head->channel_count';
+is $head->pre_skip, 356, 'head->pre_skip';
+is $head->input_sample_rate, 44100, 'head->input_sample_rate';
+is $head->output_gain, 0, 'head->output_gain';
+is $head->mapping_family, 0, 'head->mapping_family';
+is $head->stream_count, 1, 'head->stream_count';
+is $head->coupled_count, 1, 'head->coupled_count';
+is $head->mapping(0), 0, 'head->mapping(0)';
+is $head->mapping(1), 1, 'head->mapping(1)';
+eval { $head->mapping(1000) };
+isn::t $@, '', 'head->mapping(1000) dies';
+
 my $tags = $of->tags;
 is $tags->query_count('TITLE'), 1, 'query_count';
 is $tags->query('TITLE'), 'Cellule', 'query';
This page took 0.009426 seconds and 4 git commands to generate.