Skip to content

Commit

Permalink
Update plain IRIs to HTML links in tests kasei#54
Browse files Browse the repository at this point in the history
  • Loading branch information
Varadinsky committed Jan 29, 2016
1 parent b4294fd commit 98724f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions t/issue_54.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ NAMESPACEMAP:{

my $s = $sclass->new(namespaces => $map);

is ($s->node_as_html($n1), '<a href="http://xmlns.com/foaf/0.1/Person">foaf:Person</a>', 'Return HTML link for IRI');
is ($s->node_as_html($n2), 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'Return plain IRI - 1');
is ($s->node_as_html($n1), '<a href="http://xmlns.com/foaf/0.1/Person">foaf:Person</a>', 'Return HTML link for IRI with abbrev');
is ($s->node_as_html($n2), '<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</a>', 'Return HTML link for IRI - 1');

}

NO_NAMESPACEMAP:{

my $s = $sclass->new();

is ($s->node_as_html($n1), 'http://xmlns.com/foaf/0.1/Person', 'Return plain IRI - 2');
is ($s->node_as_html($n2), 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type', 'Return plain IRI - 3');
is ($s->node_as_html($n1), '<a href="http://xmlns.com/foaf/0.1/Person">http://xmlns.com/foaf/0.1/Person</a>', 'Return HTML link for IRI - 2');
is ($s->node_as_html($n2), '<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#type">http://www.w3.org/1999/02/22-rdf-syntax-ns#type</a>', 'Return HTML link for IRI - 3');

}

8 changes: 4 additions & 4 deletions t/serializer-sparqlhtml.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ END
my @rows = ($b =~ /(<tr)/g);
cmp_ok(scalar(@rows), '>=', 4, 'at least 1 header row and 3 data rows');
like($b, qr[<td>x</td>]);
like($b, qr[<td>http://example.org/p</td>]);
like($b, qr[<td><a href="http://example.org/p">http://example.org/p</a></td>]);
like($b, qr[<td>1</td>]);
like($b, qr[<td>x</td>]);
like($b, qr[<td>2</td>]);
like($b, qr[<td>http://perlrdf.org/</td>]);
like($b, qr[<td><a href="http://perlrdf.org/">http://perlrdf.org/</a></td>]);
};

subtest 'serialize_iter_to_io' => sub {
Expand All @@ -58,11 +58,11 @@ END
my @rows = ($b =~ /(<tr)/g);
cmp_ok(scalar(@rows), '>=', 4, 'at least 1 header row and 3 data rows');
like($b, qr[<td>x</td>]);
like($b, qr[<td>http://example.org/p</td>]);
like($b, qr[<td><a href="http://example.org/p">http://example.org/p</a></td>]);
like($b, qr[<td>1</td>]);
like($b, qr[<td>x</td>]);
like($b, qr[<td>2</td>]);
like($b, qr[<td>http://perlrdf.org/</td>]);
like($b, qr[<td><a href="http://perlrdf.org/">http://perlrdf.org/</a></td>]);
};
}

Expand Down

0 comments on commit 98724f7

Please sign in to comment.