# -*-perl-*- use strict; use Test::More 'no_plan'; use lib "$ENV{LJHOME}/cgi-bin"; require "parsefeed.pl"; require 'ljlib.pl'; my $testfeed = sub { my $link_content = shift; my $contents = qq { testing:atom:feed test atom feed testing 2007-01-08T23:40:33Z testing:atom:feed:entry $link_content default userpic 2006-09-14T07:39:07Z content content content }; my ($feed, $error) = LJ::ParseFeed::parse_feed($contents); my $item = $feed->{'items'}->[0]; return $item->{'link'}; }; is($testfeed->(""), $LJ::SITEROOT, "rel=alternate is fine"); is($testfeed->(""), $LJ::SITEROOT, "no explicit rel attribute is also fine"); ok(!$testfeed->(""), "rel that isn't 'alternate' not okay");