Kouhei Sutou
null+****@clear*****
Tue Oct 9 11:28:00 JST 2012
Kouhei Sutou 2012-10-09 11:28:00 +0900 (Tue, 09 Oct 2012) New Revision: 34711a7779256896e6f064af9a9ae3ce6fd6a613 https://github.com/groonga/groonga/commit/34711a7779256896e6f064af9a9ae3ce6fd6a613 Log: Move Cutter tests to grntest tests Tests for --query_expansion - is moved. Added files: test/command/suite/select/query_expansion/scalar/minus.expected test/command/suite/select/query_expansion/scalar/minus.test test/command/suite/select/query_expansion/vector/minus.expected test/command/suite/select/query_expansion/vector/minus.test Modified files: test/unit/core/test-command-select-query-expansion.c Added: test/command/suite/select/query_expansion/scalar/minus.expected (+56 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/minus.expected 2012-10-09 11:28:00 +0900 (857be3e) @@ -0,0 +1,56 @@ +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 Ruby!"], +["Learning Ruby but groonga is not leaned yet..."], +["Learning Ruby BUT groonga is not leaned yet..."] +] +[[0,0.0,0.0],4] +load --table Synonyms +[ +["_key", "words"], +["-", "BUT"] +] +[[0,0.0,0.0],1] +select --table Memos --query_expansion Synonyms.words --match_columns content --query 'Ruby - groonga' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 1 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 2, + "Start Ruby!" + ] + ] + ] +] Added: test/command/suite/select/query_expansion/scalar/minus.test (+26 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/minus.test 2012-10-09 11:28:00 +0900 (26f8933) @@ -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 Ruby!"], +["Learning Ruby but groonga is not leaned yet..."], +["Learning Ruby BUT groonga is not leaned yet..."] +] + +load --table Synonyms +[ +["_key", "words"], +["-", "BUT"] +] + +select --table Memos --query_expansion Synonyms.words \ + --match_columns content --query 'Ruby - groonga' Added: test/command/suite/select/query_expansion/vector/minus.expected (+56 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/minus.expected 2012-10-09 11:28:00 +0900 (8cf67ee) @@ -0,0 +1,56 @@ +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 Ruby!"], +["Learning Ruby but groonga is not leaned yet..."], +["Learning Ruby BUT groonga is not leaned yet..."] +] +[[0,0.0,0.0],4] +load --table Synonyms +[ +["_key", "words"], +["-", ["BUT"]] +] +[[0,0.0,0.0],1] +select --table Memos --query_expansion Synonyms.words --match_columns content --query 'Ruby - groonga' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 1 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 2, + "Start Ruby!" + ] + ] + ] +] Added: test/command/suite/select/query_expansion/vector/minus.test (+26 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/minus.test 2012-10-09 11:28:00 +0900 (bc25a0c) @@ -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 Ruby!"], +["Learning Ruby but groonga is not leaned yet..."], +["Learning Ruby BUT groonga is not leaned yet..."] +] + +load --table Synonyms +[ +["_key", "words"], +["-", ["BUT"]] +] + +select --table Memos --query_expansion Synonyms.words \ + --match_columns content --query 'Ruby - groonga' Modified: test/unit/core/test-command-select-query-expansion.c (+0 -22) =================================================================== --- test/unit/core/test-command-select-query-expansion.c 2012-10-09 11:23:44 +0900 (406681a) +++ test/unit/core/test-command-select-query-expansion.c 2012-10-09 11:28:00 +0900 (1e36fb8) @@ -186,28 +186,6 @@ data_scalar_and_vector(void) } void -data_not_expand_but(void) -{ - data_scalar_and_vector(); -} - -void -test_not_expand_but(gconstpointer data) -{ - cut_assert_equal_string( - "[[[1]," - "[[\"_id\",\"UInt32\"]," - "[\"_key\",\"Time\"]," - "[\"content\",\"Text\"]]," - "[9,1316358000.0,\"Learning Ruby and groonga...\"]]]", - send_command( - cut_take_printf("select Diaries --sortby _id " - "--match_columns content --query 'Ruby - Start' " - "--query_expansion Synonyms.%s", - gcut_data_get_string(data, "column-name")))); -} - -void data_not_expand_paren(void) { data_scalar_and_vector(); -------------- next part -------------- HTML����������������������������...Download