File: 23-eval.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 (41 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use strict;
use warnings;
use Test::More tests => 8;

use XML::Feed;
use XML::Feed::Entry;

eval {
	XML::Feed::Entry->new('Nofeed');
};
like $@, qr{Unsupported format Nofeed:}, 'Unsupported format';

{
	my $rss = XML::Feed::Entry->new('RSS');
	isa_ok $rss, 'XML::Feed::Entry::Format::RSS';

	my $atom = XML::Feed::Entry->new('Atom');
	isa_ok $atom, 'XML::Feed::Entry::Format::Atom';

	my $default = XML::Feed::Entry->new();
	isa_ok $default, 'XML::Feed::Entry::Format::Atom';
}


eval {
	XML::Feed->new('Nofeed');
};
like $@, qr{Unsupported format Nofeed:}, 'Unsupported format';

{
	my $rss = XML::Feed->new('RSS');
	isa_ok $rss, 'XML::Feed::Format::RSS';

	my $atom = XML::Feed->new('Atom');
	isa_ok $atom, 'XML::Feed::Format::Atom';

	my $default = XML::Feed->new();
	isa_ok $default, 'XML::Feed::Format::Atom';
}