File: 03strategy-microdata0.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,484 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::Microdata0;

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

ok($S, 'HTML::HTML5::Microdata::Strategy::Microdata0 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://www.w3.org/1999/xhtml/microdata#http%3A%2F%2Fschema.org%2FPerson%23%3Aname',
	'schema.org',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://schema.org/Person/Employee/AcmeCorpEmployee',
		),
	'http://www.w3.org/1999/xhtml/microdata#http%3A%2F%2Fschema.org%2FPerson%2FEmployee%2FAcmeCorpEmployee%23%3Aname',
	'schema.org extension',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://xmlns.com/foaf/0.1/Person',
		),
	'http://www.w3.org/1999/xhtml/microdata#http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2FPerson%23%3Aname',
	'slash namespace',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://example.com/vocab#Person',
		),
	'http://www.w3.org/1999/xhtml/microdata#http%3A%2F%2Fexample.com%2Fvocab%23Person%3Aname',
	'hash namespace',
	);

is($S->generate_uri(
		name => 'name',
		type => 'http://example.com/vocab/person',
		),
	'http://www.w3.org/1999/xhtml/microdata#http%3A%2F%2Fexample.com%2Fvocab%2Fperson%23%3Aname',
	'microformat profile style namespace',
	);