File: fix-aref-query.t

package info (click to toggle)
libcatmandu-rdf-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 168 kB
  • ctags: 14
  • sloc: perl: 179; makefile: 14
file content (24 lines) | stat: -rw-r--r-- 445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use Test::More;
use Catmandu ':all';

use_ok 'Catmandu::Fix::aref_query';

my $fixer = Catmandu::Fix::aref_query->new(
    field => 'title',
    query => 'dc_title'
);

my $rdf = importer('RDF', file => 't/example.ttl')->first;
($rdf->{_uri}) = keys $rdf;

$fixer->fix( $rdf );
delete $rdf->{ $rdf->{_uri} };

is_deeply $rdf, {
    '_uri' => 'http://example.org',
    title => 'BAR'
}, 'simple RDF fix';

done_testing;