Skip to content

Commit

Permalink
Move Cutter tests to grntest tests
Browse files Browse the repository at this point in the history
Tests for --query_expansion OR at the end is moved.
  • Loading branch information
kou committed Oct 9, 2012
1 parent 3d96be4 commit 5ca4ccb
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
table_create Memos TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Memos content COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
[[0,0.0,0.0],true]
column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content
[[0,0.0,0.0],true]
table_create Synonyms TABLE_PAT_KEY ShortText
[[0,0.0,0.0],true]
column_create Synonyms words COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
load --table Memos
[
["content"],
["Start groonga!"],
["Start mroonga!"],
["Start rroonga!"],
["Start Ruby or Python!"]
]
[[0,0.0,0.0],4]
load --table Synonyms
[
["_key", "words"],
["OR", "or"]
]
[[0,0.0,0.0],1]
select --table Memos --query_expansion Synonyms.words --match_columns content --query 'groonga OR'
[[0,0.0,0.0],[[[0],[["_id","UInt32"],["content","ShortText"]]]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
table_create Memos TABLE_NO_KEY
column_create Memos content COLUMN_SCALAR ShortText

table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content

table_create Synonyms TABLE_PAT_KEY ShortText
column_create Synonyms words COLUMN_SCALAR ShortText

load --table Memos
[
["content"],
["Start groonga!"],
["Start mroonga!"],
["Start rroonga!"],
["Start Ruby or Python!"]
]

load --table Synonyms
[
["_key", "words"],
["OR", "or"]
]

select --table Memos --query_expansion Synonyms.words \
--match_columns content --query 'groonga OR'
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
table_create Memos TABLE_NO_KEY
[[0,0.0,0.0],true]
column_create Memos content COLUMN_SCALAR ShortText
[[0,0.0,0.0],true]
table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
[[0,0.0,0.0],true]
column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content
[[0,0.0,0.0],true]
table_create Synonyms TABLE_PAT_KEY ShortText
[[0,0.0,0.0],true]
column_create Synonyms words COLUMN_VECTOR ShortText
[[0,0.0,0.0],true]
load --table Memos
[
["content"],
["Start groonga!"],
["Start mroonga!"],
["Start rroonga!"],
["Start Ruby or Python!"]
]
[[0,0.0,0.0],4]
load --table Synonyms
[
["_key", "words"],
["OR", ["or"]]
]
[[0,0.0,0.0],1]
select --table Memos --query_expansion Synonyms.words --match_columns content --query 'groonga OR'
[[0,0.0,0.0],[[[0],[["_id","UInt32"],["content","ShortText"]]]]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
table_create Memos TABLE_NO_KEY
column_create Memos content COLUMN_SCALAR ShortText

table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
column_create Lexicon diary_content COLUMN_INDEX|WITH_POSITION Memos content

table_create Synonyms TABLE_PAT_KEY ShortText
column_create Synonyms words COLUMN_VECTOR ShortText

load --table Memos
[
["content"],
["Start groonga!"],
["Start mroonga!"],
["Start rroonga!"],
["Start Ruby or Python!"]
]

load --table Synonyms
[
["_key", "words"],
["OR", ["or"]]
]

select --table Memos --query_expansion Synonyms.words \
--match_columns content --query 'groonga OR'
21 changes: 0 additions & 21 deletions test/unit/core/test-command-select-query-expansion.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,6 @@ data_scalar_and_vector(void)
#undef ADD_DATA
}

void
data_not_expand_OR_at_the_end(void)
{
data_scalar_and_vector();
}

void
test_not_expand_OR_at_the_end(gconstpointer data)
{
cut_assert_equal_string(
"[[[0],"
"[[\"_id\",\"UInt32\"],"
"[\"_key\",\"Time\"],"
"[\"content\",\"Text\"]]]]",
send_command(
cut_take_printf("select Diaries --sortby _id "
"--match_columns content --query OR "
"--query_expansion Synonyms.%s",
gcut_data_get_string(data, "column-name"))));
}

void
data_not_expand_OR_with_leading_space(void)
{
Expand Down

0 comments on commit 5ca4ccb

Please sign in to comment.