File: 24-identify-feed.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 (19 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;
use Test::More;
use XML::Feed;
use URI;

my %feeds = (
    't/samples/atom.xml' => 'Atom',
    't/samples/rss10.xml' => 'RSS',
    't/samples/rss20.xml' => 'RSS',
);
plan tests => scalar keys %feeds;

for my $file (keys %feeds) {
    my $feed = XML::Feed->parse($file);
    my $xml  = $feed->as_xml;
    my $format = XML::Feed->identify_format(\$xml);
    is($format, $feeds{$file});
}