Test::RDF::Trine::Store - A collection of functions to test RDF::Trine::Stores


RDF-Trine documentation  | view source Contained in the RDF-Trine distribution.

Index


NAME

Top

Test::RDF::Trine::Store - A collection of functions to test RDF::Trine::Stores

VERSION

Top

This document describes RDF::Trine version 0.135

SYNOPSIS

Top

For example, to test a Memory store, do something like:

  use Test::RDF::Trine::Store qw(all_store_tests number_of_tests);
  use Test::More tests => 1 + Test::RDF::Trine::Store::number_of_tests;

  use RDF::Trine qw(iri variable store literal);
  use RDF::Trine::Store;

  my $data = Test::RDF::Trine::Store::create_data;

  my $store	= RDF::Trine::Store::Memory->temporary_store();
  isa_ok( $store, 'RDF::Trine::Store::Memory' );
  Test::RDF::Trine::Store::all_store_tests($store, $data);







DESCRIPTION

Top

This packages a few functions that you can call to test a RDF::Trine::Store, also if it is outside of the main RDF-Trine distribution.

There are different functions that will test different parts of the functionality, but you should run them all at some point, thus for the most part, you would just like to run the all_store_tests function.

All the below functions are exported.

FUNCTIONS

Top

number_of_tests

Returns the number of tests run with all_store_tests.

create_data

Returns a hashref with generated test data nodes to be used by other tests.

all_store_tests ($store, $data, $todo)

Will run all available tests for the given store, given the data from create_data. You may also set a third argument to some true value to mark all tests as TODO in case the store is in development.

add_quads($store, @quads)

Helper function to add an array of quads to the given store.

add_triples($store, @triples)

Helper function to add an array of triples to the given store.

contexts_tests( $store )

Testing contexts (aka. "graphs")

add_statement_tests_simple( $store, $data->{ex} )

Tests to check add_statement.

literals_tests_simple( $store, $data->{ex} )

Tests to check literals support.

blank_node_tests_simple( $store, $data->{ex} )

Tests to check blank node support.

count_statements_tests_simple( $store, $data->{ex} )

Tests to check that counts are correct.

count_statements_tests_quads( $store, $data->{ex} )

Count statement tests for quads.

count_statements_tests_triples( $store, $data->{ex}, $data->{nil} )

More tests for counts, with triples.

get_statements_tests_triples( $store, $data->{ex} )

Tests for getting statements using triples.

get_statements_tests_quads( $store, $data->{ex}, $data->{nil} )

Tests for getting statements using quads.

remove_statement_tests( $store, $data->{ex}, @{$data->{names}} );

Tests for removing statements.

AUTHOR

Top

 Gregory Todd Williams <gwilliams@cpan.org> and Kjetil Kjernsmo <kjetilk@cpan.org>


RDF-Trine documentation  | view source Contained in the RDF-Trine distribution.