Refactor SC tests, separating encodings out into their own test file. TEST_ENCODINGS=1 to run this new test. 8/13 tests fail.

This commit is contained in:
Colin Kuskie 2010-08-24 15:24:22 -07:00
parent 406b8219c3
commit f39a13912e
14 changed files with 293 additions and 151 deletions

View file

@ -163,16 +163,18 @@ sub generateFeed {
}
my $cache = WebGUI::Cache->new($self->session, $url, "RSS");
my $value = $cache->get;
#warn "got this: $value\n";
unless ($value) {
$value = $cache->setByHTTP($url, $self->get("cacheTimeout"));
$newlyCached = 1;
}
#warn "got this: $value\n";
# if the content can be downgraded, it is either valid latin1 or didn't have
# an HTTP Content-Encoding header. In the second case, XML::FeedPP will take
# care of any encoding specified in the XML prolog
utf8::downgrade($value, 1);
utf8::downgrade($value, 1) ? 1 : 0;
eval {
my $singleFeed = XML::FeedPP->new($value, utf8_flag => 1, -type => 'string', @opt);
my $singleFeed = XML::FeedPP->new($value, utf8_flag => 1, -type => 'string', xml_deref => 1, @opt);
$feed->merge_channel($singleFeed);
$feed->merge_item($singleFeed);
};
@ -181,7 +183,6 @@ sub generateFeed {
}
}
# build a new feed that matches the term the user is interested in
if ($self->get('hasTerms') ne '') {
my @terms = split /,\s*/, $self->get('hasTerms'); # get the list of terms