File: 01basic.t

package info (click to toggle)
librdf-vcard-perl 0.012-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 280 kB
  • sloc: perl: 1,662; makefile: 5
file content (37 lines) | stat: -rw-r--r-- 697 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
use Test::More tests => 6;
BEGIN { use_ok('RDF::vCard') };

ok(
	RDF::vCard::Importer->can('new'),
	"RDF::vCard::Importer can be instantiated.",
	);

ok(
	RDF::vCard::Exporter->can('new'),
	"RDF::vCard::Exporter can be instantiated.",
	);
ok(
	RDF::vCard::Line->can("new"),
	"RDF::vCard::Line can be instantiated.",
	);

my $line = RDF::vCard::Line->new(
	property        => "email",
	value           => "joe\@example.net",
	type_parameters => { type=>[qw(PREF INTERNET)] },
	);

is(
	"$line",
	"EMAIL;TYPE=PREF,INTERNET:joe\@example.net",
	"Lines seem formatted correctly.",
	);

my $card = RDF::vCard::Entity->new;
$card->add($line);

ok(
	"$card" =~ /example.net/,
	"Cards seem to work.",
	);