From 3e33c156821b1f174102272051cf6bdaca24922f Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Mon, 16 Feb 2015 17:39:52 +1000 Subject: [PATCH] + t/m3u.t --- t/m3u.t | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 t/m3u.t diff --git a/t/m3u.t b/t/m3u.t new file mode 100644 index 0000000..56998dc --- /dev/null +++ b/t/m3u.t @@ -0,0 +1,40 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use lib 'lib'; + +use POSIX qw(tmpnam); +use Test::More tests => 3; + +require_ok('Playlist::M3U'); + +my $pls = new_ok('Playlist::M3U' => []); + +my $path = tmpnam(); +open my $FH, ">", $path; +print $FH < { 'cn-id' => '10338245' }, + file => 'http://127.0.0.1:1027/udp/224.3.22.7:1234', + title => 'First channel', + duration => '-1', +}, { + attrs => { 'cn-id' => '34727751' }, + file => 'http://127.0.0.1:1027/udp/224.3.23.9:1234', + title => 'Second channel +8', + duration => '-1', +}]; + +is_deeply(scalar $pls->load($path), $out, "Loading test playlist"); +unlink $path; + +exit 0;