Test::...::Store(3pm)
β¨ NAME β¨
ok so this is Test::RDF::Trine::Store, bestie π β it's a whole collection of functions whose entire job is testing RDF::Trine::Stores. That's the manual page Test::...::Store(3pm), and yes we're getting into it.
πΈ VERSION πΈ
This doc is describing RDF::Trine version 1.019, no cap.
π¦ SYNOPSIS π¦
say you wanna test a Memory store? literally just do something like this, it's giving effortless:
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);
periodt. π
π DESCRIPTION π
so this module bundles up a few functions you can call to test an RDF::Trine::Store β and lowkey the best part is it works even if that store lives outside the main RDF-Trine distribution. main character energy for real π
There's a bunch of different functions that each poke at different parts of the functionality, but you should honestly run them all at some point. so for the most part? you're just gonna wanna run the all_store_tests function for quad stores, and all_triple_store_tests for triple stores (iykyk β that means stores that don't support named graphs).
and listen: all the functions below are exported. every single one. π«Ά
π₯ FUNCTIONS π₯
number_of_testsβ hands you back the number of tests that get run withall_store_tests.number_of_triple_testsβ same vibe, but it returns the number of tests run withall_triple_store_tests.create_dataβ returns a hashref stuffed with generated test data nodes, for the other tests to snack on.all_store_tests ($store, $data, $todo, $args)β runs all the available tests for the given store, using the data that came out ofcreate_data. You can also set a third argument to some true value to mark every test as TODO, for when the store is still in development (we've all been there π).
And finally, an $args hashref can be passed in. The valid keys are update_sleep (peep the function with the same name, down below) and suppress_dupe_tests if the store should skip duplicate detection, and quads_unsupported if the store is actually a triple store.
all_triple_store_tests ($store, $data, $todo, $args)β runs tests for the given triple store, i.e. a store that only accepts triples, using the data fromcreate_data. Same deal with the third argument: set it to some true value and all tests get marked as TODO in case the store is in development.
For $args, look above, bestie. π
add_quads($store, $args, @quads)β lil helper function that adds an array of quads to the given store.add_triples($store, $args, @triples)β same energy, but it adds an array of triples to the given store.contexts_tests( $store, $args )β testing contexts (aka. "graphs") πadd_statement_tests_simple( $store, $args, $data->{ex} )β tests to checkadd_statement.bulk_add_statement_tests_simple( $store, $args, $data->{ex} )β also tests to checkadd_statement.literals_tests_simple( $store, $args, $data->{ex})β tests to check literals support.blank_node_tests_quads( $store, $args, $data->{ex} )β tests to check blank node support for quads.blank_node_tests_triples( $store, $args, $data->{ex} )β tests to check blank node support for triples.count_statements_tests_simple( $store, $args, $data->{ex} )β tests to check that the counts are correct. (count 'em! π’)count_statements_tests_quads( $store, $args, $data->{ex} )β count statement tests, but for quads.count_statements_tests_triples( $store, $args, $data->{ex}, $data->{nil} )β even more tests for counts, this time with triples.get_statements_tests_triples( $store, $args, $data->{ex} )β tests for getting statements using triples.get_statements_tests_quads( $store, $args, $data->{ex}, $data->{nil} )β tests for getting statements using quads.get_pattern_tests( $store, $args, $data->{ex} )β tests for getting statements using withget_pattern.remove_statement_tests( $store, $args, $data->{ex}, @{$data->{names}} );β tests for removing statements.update_sleep ( \%args )β if$args{ update_sleep }is defined, it sleeps for that many seconds. This function gets called after update operations, to help out with testing stores that do their updates asynchronously. (go to sleep bestie, you deserve it π΄)
π BUGS π
found a bug or want a feature? please report it through the GitHub web interface at <https://github.com/kasei/perlrdf/issues>. we're not mad, we just wanna know π
π AUTHOR π
Gregory Todd Williams <gwilliams@cpan.org> and Kjetil Kjernsmo <kjetilk@cpan.org> β absolute icons, both of them. π
and that's the whole page, bestie!! this was perl v5.38.2, dated 2024-01-13, and honestly it ate. slay, stay safe, and go test those stores. πβ¨π¦
π¦ where this page comes from
- debian trixie: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librdf-trine-perl 1.019-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms