Permalink
Browse files

Add test for XML::Feed->identify_format()

  • Loading branch information...
1 parent 69c2ffa commit 09698b3d562c8f961efdda0f833e4cd211726536 @minty minty committed Mar 18, 2013
Showing with 17 additions and 0 deletions.
  1. +17 −0 t/24-identify-feed.t
View
@@ -0,0 +1,17 @@
+use strict;
+use Test::More tests => 3;
+use XML::Feed;
+use URI;
+
+my %Feeds = (
+ 't/samples/atom.xml' => 'Atom',
+ 't/samples/rss10.xml' => 'RSS',
+ 't/samples/rss20.xml' => 'RSS',
+);
+
+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});
+}

0 comments on commit 09698b3

Please sign in to comment.