t/24-identify-feed.t
raw| 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More; |
| 4 | use XML::Feed; |
| 5 | use URI; |
| 6 | |
| 7 | my %feeds = ( |
| 8 | 't/samples/atom.xml' => 'Atom', |
| 9 | 't/samples/rss10.xml' => 'RSS', |
| 10 | 't/samples/rss20.xml' => 'RSS', |
| 11 | ); |
| 12 | plan tests => scalar keys %feeds; |
| 13 | |
| 14 | for my $file (keys %feeds) { |
| 15 | my $feed = XML::Feed->parse($file); |
| 16 | my $xml = $feed->as_xml; |
| 17 | my $format = XML::Feed->identify_format(\$xml); |
| 18 | is($format, $feeds{$file}); |
| 19 | } |