Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/AnyEvent/Groonga.pm
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ sub _load_filter {
$json =~ s/\\/\\\\\\\\/g;
$json =~ s/'/\\'/g;
$json =~ s/"/\\"/g;
$json =~ s/`/\\`/g;
}
if ( ref $data ne 'ARRAY' ) {
$json = '[' . $json . ']';
Expand Down
15 changes: 11 additions & 4 deletions t/04_tut.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use AnyEvent::Groonga;
use Test::More;
use FindBin;
use File::Spec;
use File::Basename qw( dirname );

_cleanup();

Expand All @@ -20,6 +21,11 @@ else {
plan tests => 21;
}

# create data directory.
unless( -d dirname($test_database_path) ) {
mkdir( dirname($test_database_path) ) or die "can't create the data directory for groonga";
}

`$groonga_path -n $test_database_path quit`;

$g->protocol("local_db");
Expand All @@ -40,7 +46,8 @@ $result = $g->call(
}
)->recv;

is( $result->body, "true" );
# return 1 on groonga version 9.0.0.
like( $result->body, qr/true|1/ );

# select
$result = $g->call( select => { table => "Site" } )->recv;
Expand All @@ -58,7 +65,7 @@ $result = $g->call(
}
)->recv;

is( $result->body, "true" );
like( $result->body, qr/true|1/ );

# table_create Terms
$result = $g->call(
Expand All @@ -70,7 +77,7 @@ $result = $g->call(
}
)->recv;

is( $result->body, "true" );
like( $result->body, qr/true|1/ );

# column_create Terms
$result = $g->call(
Expand All @@ -83,7 +90,7 @@ $result = $g->call(
}
)->recv;

is( $result->body, "true" );
like( $result->body, qr/true|1/ );

# load
my $data = [
Expand Down
16 changes: 15 additions & 1 deletion t/05_regression.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use AnyEvent::Groonga;
use Test::More;
use FindBin;
use File::Spec;
use File::Basename qw(dirname);

unlink $_ for glob( File::Spec->catfile( $FindBin::RealBin, "data", "*") );

Expand All @@ -21,6 +22,11 @@ else{
plan tests => 2;
}

# create data directory.
unless( -d dirname($test_database_path) ) {
mkdir( dirname($test_database_path) ) or die "can't create the data directory for groonga";
}

`$groonga_path -n $test_database_path quit`;

$g->protocol("local_db");
Expand Down Expand Up @@ -55,6 +61,9 @@ $g->call(
{ _key => "http://example.com/jpn",
title => "日本語を含むレコード",
},
{ _key => "http://example.com/swz",
title => "test record containing backquote` character.",
}
);

my $result = $g->call(
Expand All @@ -63,7 +72,7 @@ $g->call(
values => \@data,
}
)->recv;
is( $result->body, 3 );
is( $result->body, 4 );

$result = $g->call( select => { table => "Site" } )->recv;

Expand All @@ -82,6 +91,11 @@ $g->call(
_key => "http://example.com/jpn",
title => "日本語を含むレコード",
},
{
_id => 4,
_key => "http://example.com/swz",
title => "test record containing backquote` character.",
},
]
);
}