File: gin.t

package info (click to toggle)
libkiokudb-perl 0.57-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,396 kB
  • sloc: perl: 13,314; makefile: 12
file content (55 lines) | stat: -rw-r--r-- 893 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;
use KiokuDB::Test;

use Scalar::Util qw(refaddr);

use KiokuDB::GIN;
use KiokuDB;

use KiokuDB::Backend::Hash;
use KiokuDB::Test::Fixture::Small;

use Search::GIN::Query::Class;
use Search::GIN::Extract::Class;

{
    package KiokuDB_Test_MyGIN;
    use Moose;

    extends qw(KiokuDB::Backend::Hash);

    with (
	    'KiokuDB::GIN',
	    'Search::GIN::Driver::Hash' => { -excludes => 'clear' },
	    'Search::GIN::Extract::Delegate',
    );

    sub clear {
        my $self = shift;

        # UGH
        $self->Search::GIN::Driver::Hash::clear(@_);
        $self->SUPER::clear(@_);
    }

    __PACKAGE__->meta->make_immutable;
}

my $gin = KiokuDB_Test_MyGIN->new(
    extract => Search::GIN::Extract::Class->new,
    root_only => 0,
);

my $dir = KiokuDB->new(
    backend => $gin,
);

run_all_fixtures($dir);


done_testing;