File: 22-bug73160.t

package info (click to toggle)
libxml-feed-perl 0.65%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 508 kB
  • sloc: perl: 1,162; xml: 682; makefile: 4
file content (27 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;

use Test::More;
use XML::Feed;

plan skip_all => "t/samples/rss10-datespaces.xml does not exist" if(! -f "t/samples/rss10-datespaces.xml");

my $file = 't/samples/rss10-datespaces.xml';
my $feed = XML::Feed->parse($file);
isa_ok($feed, 'XML::Feed::Format::RSS');
ok(my $date = $feed->modified, 'Got a feed modified date');
isa_ok($date, 'DateTime');

my $link = $feed->link;
unlike($link, qr[^\s], 'No spaces at start of link');
unlike($link, qr[\s$], 'No spaces at end of link');

my $entry = ($feed->entries)[0];
ok(my $iss = $entry->issued, 'Got an entry issued date');
isa_ok($iss, 'DateTime');

$link = $entry->link;
unlike($link, qr[^\s], 'No spaces at start of link');
unlike($link, qr[\s$], 'No spaces at end of link');

done_testing;