File: store-dbi-sqlite.t

package info (click to toggle)
librdf-trine-perl 1.015-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,188 kB
  • ctags: 1,059
  • sloc: perl: 17,584; makefile: 30; sql: 20
file content (39 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use FindBin '$Bin';
use lib "$Bin/lib";


use RDF::Trine qw(iri literal statement);
use Test::RDF::Trine::Store qw(all_store_tests number_of_tests);
use File::Temp qw(tempfile);

use strict;
use Test::More;

plan tests => 2 + Test::RDF::Trine::Store::number_of_tests;

use strict;
use warnings;
no warnings 'redefine';

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

my $data = Test::RDF::Trine::Store::create_data;
my ($fh, $filename) = tempfile();
my $store	= RDF::Trine::Store::DBI::SQLite->new({
	storetype => 'DBI',
	name      => 'test',
	dsn       => "dbi:SQLite:dbname=$filename",
	username  => '',
	password  => ''
});

note($filename);
isa_ok( $store, 'RDF::Trine::Store::DBI' );
Test::RDF::Trine::Store::all_store_tests($store, $data);
undef $fh;
unlink($filename);

my $hash	= $store->can('_mysql_hash')->('Rhttp://testme.com/');
my $bits	= sprintf("%064b", $hash);
is(substr($bits, 0, 1), '0', 'SQLite hashes do not overflow');