summaryrefslogtreecommitdiff
path: root/t/tests/model/music-file.t
diff options
context:
space:
mode:
Diffstat (limited to 't/tests/model/music-file.t')
-rw-r--r--t/tests/model/music-file.t32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/tests/model/music-file.t b/t/tests/model/music-file.t
new file mode 100644
index 0000000..2016f8e
--- /dev/null
+++ b/t/tests/model/music-file.t
@@ -0,0 +1,32 @@
+use v6.d.PREVIEW;
+use Test;
+use Ultramarine::Model::MusicFile;
+
+# test file generated with:
+# avconv -ac 2 -ar 44100 -f s16le -i /dev/zero -t 1 -q 0 -metadata title="some title" -metadata artist="some artist" test.mp3
+
+my Ultramarine::Model::MusicFile $mf .= new(:path('t/data/test.mp3'));
+my $data = $mf.metadata;
+
+is-deeply(
+ $data,
+ %(
+ :bit_rate("33633.000000"),
+ :duration("1.044898"),
+ :filename("t/data/test.mp3"),
+ :format_long_name("MP2/3 (MPEG audio layer 2/3)"),
+ :format_name("mp3"),
+ :nb_streams(1),
+ :size("4393.000000"),
+ :start_time("0.000000"),
+ :tags(%(
+ :artist("some artist"),
+ :encoder("Lavf56.1.0"),
+ :title("some title"),
+ )),
+ ),
+ 'metadata should match',
+);
+
+done-testing;
+