|
|
|
@ -5,21 +5,23 @@ use warnings;
|
|
|
|
|
use lib 'lib'; |
|
|
|
|
|
|
|
|
|
use POSIX qw(tmpnam); |
|
|
|
|
use Test::More tests => 3; |
|
|
|
|
use Test::More tests => 4; |
|
|
|
|
|
|
|
|
|
require_ok('Text::Playlist::M3U'); |
|
|
|
|
|
|
|
|
|
my $pls = new_ok('Text::Playlist::M3U' => []); |
|
|
|
|
|
|
|
|
|
my $path = tmpnam(); |
|
|
|
|
open my $FH, ">", $path; |
|
|
|
|
print $FH <<EOF; |
|
|
|
|
my $text = <<M3U; |
|
|
|
|
#EXTM3U aspect-ratio=4:3 |
|
|
|
|
#EXTINF:-1 cn-id=10338245,First channel |
|
|
|
|
http://127.0.0.1:1027/udp/224.3.22.7:1234 |
|
|
|
|
#EXTINF:-1 cn-id=34727751,Second channel +8 |
|
|
|
|
http://127.0.0.1:1027/udp/224.3.23.9:1234 |
|
|
|
|
EOF |
|
|
|
|
M3U |
|
|
|
|
|
|
|
|
|
my $path = tmpnam(); |
|
|
|
|
open my $FH, ">", $path; |
|
|
|
|
print $FH $text; |
|
|
|
|
close $FH; |
|
|
|
|
|
|
|
|
|
my $out = [{ |
|
|
|
@ -37,4 +39,6 @@ my $out = [{
|
|
|
|
|
is_deeply(scalar $pls->load($path), $out, "Loading test playlist"); |
|
|
|
|
unlink $path; |
|
|
|
|
|
|
|
|
|
is($text, $pls->dump); |
|
|
|
|
|
|
|
|
|
exit 0; |
|
|
|
|