Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
use XML::Feed; | ||
|
||
my $feed = XML::Feed->parse('t/samples/rss-guid.xml'); | ||
|
||
for my $item ($feed->items) { | ||
my $re = $item->category; | ||
my $desc = $item->summary->body; | ||
like($item->id, qr/$re/, $desc); | ||
} | ||
|
||
done_testing(); | ||
|
||
__DATA__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<rss version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml"> | ||
<channel> | ||
<title>First Weblog</title> | ||
<link>http://localhost/weblog/</link> | ||
<description>This is a test weblog.</description> | ||
<language>en-us</language> | ||
<copyright>Copyright 2004</copyright> | ||
<lastBuildDate>Sat, 29 May 2004 23:39:25 -0800</lastBuildDate> | ||
<pubDate>Sat, 29 May 2004 23:39:57 -0800</pubDate> | ||
<generator>http://www.movabletype.org/?v=3.0D</generator> | ||
<docs>http://blogs.law.harvard.edu/tech/rss</docs> | ||
<webMaster>Melody</webMaster> | ||
|
||
<item> | ||
<title>Entry Two - link and id differ, isPermaLink="true"</title> | ||
<description><![CDATA[Found id from "permaLink": <guid isPermaLink="true">]]></description> | ||
<xhtml:body><![CDATA[<p>Hello!</p>]]></xhtml:body> | ||
<link>http://localhost/weblog/2004/05/pets.html</link> | ||
<author>Melody</author> | ||
<guid isPermaLink="true">http://localhost/weblog/2004/05/cats.html</guid> | ||
<category>cats</category> | ||
<pubDate>Sat, 29 May 2004 23:39:25 -0800</pubDate> | ||
</item> | ||
|
||
<item> | ||
<title>Entry Two - link and id differ, isPermaLink="false"</title> | ||
<description><![CDATA[Found id from "guid": <guid isPermaLink="false">]]></description> | ||
<xhtml:body><![CDATA[<p>Hello!</p>]]></xhtml:body> | ||
<link>http://localhost/weblog/2004/05/pets.html</link> | ||
<author>Melody</author> | ||
<guid isPermaLink="false">http://localhost/weblog/2004/05/dogs.html</guid> | ||
<category>dogs</category> | ||
<pubDate>Sat, 29 May 2004 23:39:25 -0800</pubDate> | ||
</item> | ||
|
||
<item> | ||
<title>Entry Two - link and no id</title> | ||
<description><![CDATA[Found id from "link": no <guid>]]></description> | ||
<xhtml:body><![CDATA[<p>Hello!</p>]]></xhtml:body> | ||
<link>http://localhost/weblog/2004/05/pets.html</link> | ||
<author>Melody</author> | ||
<category>pets</category> | ||
<pubDate>Sat, 29 May 2004 23:39:25 -0800</pubDate> | ||
</item> | ||
|
||
</channel> | ||
</rss> |