File: 17-double.t

package info (click to toggle)
libxml-feed-perl 0.63%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 508 kB
  • sloc: perl: 1,158; xml: 682; makefile: 4
file content (24 lines) | stat: -rw-r--r-- 840 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;

use Test::More 'no_plan';

use XML::Feed;

my $rss = XML::Feed->parse('t/samples/rss10-double.xml');
isa_ok($rss, 'XML::Feed::Format::RSS');
my $rss_entry = ($rss->entries)[0];
isa_ok($rss_entry, 'XML::Feed::Entry::Format::RSS');
my $rss_content = $rss_entry->content;
isa_ok($rss_content, 'XML::Feed::Content');
is($rss_content->type, 'text/html', 'Correct content type');
like($rss_content->body, qr(<|&lt;), 'Contains HTML tags');

my $atom = $rss->convert('Atom');
isa_ok($atom, 'XML::Feed::Format::Atom');
my $atom_entry = ($atom->entries)[0];
isa_ok($atom_entry, 'XML::Feed::Entry::Format::Atom');
my $atom_content = $atom_entry->content;
isa_ok($atom_content, 'XML::Feed::Content');
is($atom_content->type, 'text/html', 'Correct content type');
like($atom_content->body, qr(<|&lt;), 'Contains HTML tags');