#!/usr/bin/perl use strict; use warnings; use lib 'lib'; use POSIX qw(tmpnam); use Test::More tests => 3; require_ok('Text::Playlist::XSPF'); my $xspf = new_ok('Text::Playlist::XSPF' => []); my $path = tmpnam(); open my $FH, ">", $path; print $FH < Windows Path file:///C:/music/foo.mp3 Linux Path file:///media/music/foo.mp3 Relative Path music/foo.mp3 External Example http://www.example.com/music/bar.ogg EOF close $FH; my $out = [{ location => 'file:///C:/music/foo.mp3', title => 'Windows Path', }, { title => 'Linux Path', location => 'file:///media/music/foo.mp3', }, { title => 'Relative Path', location => 'music/foo.mp3', }, { title => 'External Example', location => 'http://www.example.com/music/bar.ogg', }]; is_deeply(scalar $xspf->load($path), $out, "Loading test playlist"); unlink $path; exit 0;