Alex 'AdUser' Z
10 years ago
1 changed files with 35 additions and 0 deletions
@ -0,0 +1,35 @@
|
||||
#!/usr/bin/perl |
||||
|
||||
use strict; |
||||
use warnings; |
||||
use lib 'lib'; |
||||
|
||||
use POSIX qw(tmpnam); |
||||
use Test::More tests => 3; |
||||
|
||||
require_ok('Playlist::PLS'); |
||||
|
||||
my $pls = new_ok('Playlist::PLS' => []); |
||||
|
||||
my $path = tmpnam(); |
||||
open my $FH, ">", $path; |
||||
print $FH <<EOF; |
||||
[playlist] |
||||
numberofentries=1 |
||||
File1 = http://1.2.3.4:8000/listen.aac |
||||
Title1=(#1 - 1/1) Radio Broadcast |
||||
Length1=-1 |
||||
Version=2 |
||||
EOF |
||||
close $FH; |
||||
|
||||
my $out = [{ |
||||
file => 'http://1.2.3.4:8000/listen.aac', |
||||
title => '(#1 - 1/1) Radio Broadcast', |
||||
length => '-1', |
||||
}]; |
||||
is_deeply(scalar $pls->load($path), $out, "Loading test playlist"); |
||||
|
||||
unlink $path; |
||||
|
||||
exit 0; |
Loading…
Reference in new issue