File: 02strategy-heuristic.t

package info (click to toggle)
libhtml-html5-microdata-parser-perl 0.100-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 400 kB
  • sloc: perl: 4,036; makefile: 7; sh: 1
file content (54 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (3)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
use Test::More tests => 7;
use HTML::HTML5::Microdata::Strategy::Heuristic;

my $S = HTML::HTML5::Microdata::Strategy::Heuristic->new;

ok($S, 'HTML::HTML5::Microdata::Strategy::Heuristic instantiated');

is($S->generate_uri(
		name => 'http://example.com/term',
		type => 'http://example.com/Class',
		),
	'http://example.com/term',
	'Property that is already a URI is passed through.',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://schema.org/Person',
		),
	'http://schema.org/name',
	'schema.org',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://schema.org/Person/Employee/AcmeCorpEmployee',
		),
	'http://schema.org/name',
	'schema.org extension',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://xmlns.com/foaf/0.1/Person',
		),
	'http://xmlns.com/foaf/0.1/name',
	'slash namespace',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://example.com/vocab#Person',
		),
	'http://example.com/vocab#name',
	'hash namespace',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://example.com/vocab/person',
		),
	'http://example.com/vocab/person#name',
	'microformat profile style namespace',
	);