Skip to content

Commit

Permalink
add tests for issue kasei#44
Browse files Browse the repository at this point in the history
  • Loading branch information
Varadinsky committed Oct 16, 2016
1 parent 1ef5aea commit 02ad522
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions t/issue_44.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
use strict;
use warnings;

use Test::More tests => 3;

use v5.14;
use Attean;

my $ns = {foaf => 'http://xmlns.com/foaf/0.1/'};
my $map = URI::NamespaceMap->new($ns);

my $value = Attean::ValueExpression->new(value => Attean::IRI->new('http://xmlns.com/foaf/0.1/person'));

is ($value->as_sparql(namespaces => $map), <<IRI, 'as_sparql with URI::NamespaceMap object passed as namespace value');
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
foaf:person
IRI

is ($value->as_sparql(namespaces => $map), <<IRI, 'as_sparql with HASH ref passed as namespace value');
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
foaf:person
IRI

is ($value->as_sparql(),<<IRI, 'as_sparql without arguments');
<http://xmlns.com/foaf/0.1/person>
IRI

0 comments on commit 02ad522

Please sign in to comment.