-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4782 from cyrusimap/xapian_query_fullwidth_halfwidth
xapian_wrap.cpp: query verbatim for terms using fullwidth form
- Loading branch information
Showing
2 changed files
with
132 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!perl | ||
use Cassandane::Tiny; | ||
|
||
sub test_email_query_cjk_fullwidth | ||
:min_version_3_9 :needs_component_jmap :JMAPExtensions | ||
{ | ||
my ($self) = @_; | ||
my $jmap = $self->{jmap}; | ||
|
||
use utf8; | ||
my $res = $jmap->CallMethods([ | ||
['Email/set', { | ||
create => { | ||
email1 => { | ||
mailboxIds => { | ||
'$inbox' => JSON::true | ||
}, | ||
from => [{ email => 'foo@local' }], | ||
to => [{ email => 'bar@local' }], | ||
subject => $_->{id}, | ||
bodyStructure => { | ||
type => 'text/plain', | ||
partId => 'part1', | ||
}, | ||
bodyValues => { | ||
part1 => { | ||
value => <<'EOF' | ||
三菱UFJファクター株式会社 | ||
EOF | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, 'R1'], | ||
]); | ||
my $email1Id = $res->[0][1]{created}{email1}{id}; | ||
$self->assert_not_null($email1Id); | ||
|
||
xlog $self, "run squatter"; | ||
$self->{instance}->run_command({cyrus => 1}, 'squatter'); | ||
|
||
my $res = $jmap->CallMethods([ | ||
['Email/query', { | ||
filter => { | ||
body => "UFJ", | ||
}, | ||
}, 'R1'], | ||
['Email/query', { | ||
filter => { | ||
body => "三菱UFJファクター株式会社", | ||
}, | ||
}, 'R2'], | ||
['Email/query', { | ||
filter => { | ||
body => "三菱UFJ", | ||
}, | ||
}, 'R3'], | ||
['Email/query', { | ||
filter => { | ||
body => "三菱", | ||
}, | ||
}, 'R4'], | ||
]); | ||
$self->assert_deep_equals([$email1Id], $res->[0][1]{ids}); | ||
$self->assert_deep_equals([$email1Id], $res->[1][1]{ids}); | ||
$self->assert_deep_equals([$email1Id], $res->[2][1]{ids}); | ||
$self->assert_deep_equals([$email1Id], $res->[3][1]{ids}); | ||
|
||
no utf8; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters