Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Jul 1, 2013
1 parent cf5814f commit 68403d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ install:
# Deal with all of the DZIL dependancies, quickly and quietly
- cpanm --quiet --notest --skip-satisfied Dist::Zilla
- dzil authordeps | grep -vP '[^\w:]' | xargs -n 5 -P 10 cpanm --quiet --notest --skip-satisfied

- export RELEASE_TESTING=1 AUTOMATED_TESTING=1 AUTHOR_TESTING=1 HARNESS_OPTIONS=j10:c HARNESS_TIMER=1
- dzil listdeps | grep -vP '[^\w:]' | cpanm --verbose --notest

Expand Down
3 changes: 3 additions & 0 deletions lib/RDF/Lazy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,16 @@ sub uri {

my ($prefix,$local,$uri);

print STDERR "# NODE: $node\n";

if ( $node =~ /^<(.*)>$/ ) {
return RDF::Lazy::Resource->new( $self, $1 );
} elsif ( $node =~ /^_:(.*)$/ ) {
return RDF::Lazy::Blank->new( $self, $1 );
} elsif ( $node =~ /^\[\s*\]$/ ) {
return RDF::Lazy::Blank->new( $self );
} elsif ( $node =~ /^["'+-0-9]|^(true|false)$/ ) {
print STDERR "# LITERAL\n";
return $self->_literal( $node );
} elsif ( $node =~ /^([^:]*):([^:]*)$/ ) {
($prefix,$local) = ($1,$2);
Expand Down
4 changes: 4 additions & 0 deletions t/10_parse.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ is( $rdf->size, 4, 'rdf data as first parameter' );
$rdf = RDF::Lazy->new( rdf => $data );
is( $rdf->str, "4 triples", 'rdf data with named parameter' );

print STDERR "# 'hello'\n";
my $s = $rdf->uri('"hello"');
ok( $s->is_literal, 'parse plain literal');
is( $s->str, "hello", 'parse plain literal' );

print STDERR "# 'hello'\@en\n";
$s = $rdf->uri('"hello"@en');
ok( $s->is_literal, 'parse literal');
is( $s->lang, "en", 'parse literal with language' );

$s = $rdf->uri('true');
Expand Down

0 comments on commit 68403d7

Please sign in to comment.