Kouhei Sutou
null+****@clear*****
Fri Oct 5 13:40:13 JST 2012
Kouhei Sutou 2012-10-05 13:40:13 +0900 (Fri, 05 Oct 2012) New Revision: 1bff9c91cb87acfb76cddeb06370be8b7199e597 https://github.com/groonga/groonga/commit/1bff9c91cb87acfb76cddeb06370be8b7199e597 Log: Move Cutter tests to grntest tests Tests for --query_expansion for column:@value is moved. Added files: test/command/suite/select/query_expansion/scalar/column_value.expected test/command/suite/select/query_expansion/scalar/column_value.test test/command/suite/select/query_expansion/vector/column_value.expected test/command/suite/select/query_expansion/vector/column_value.test Modified files: test/unit/core/test-command-select-query-expansion.c Added: test/command/suite/select/query_expansion/scalar/column_value.expected (+64 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/column_value.expected 2012-10-05 13:40:13 +0900 (61841d4) @@ -0,0 +1,64 @@ +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!"] +] +[[0,0.0,0.0],4] +load --table Synonyms +[ +["_key", "words"], +["groonga", "(groonga OR rroonga OR mroonga)"] +] +[[0,0.0,0.0],1] +select --table Memos --query_expansion Synonyms.words --query 'content:@groonga' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 3 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 1, + "Start groonga!" + ], + [ + 3, + "Start rroonga!" + ], + [ + 2, + "Start mroonga!" + ] + ] + ] +] Added: test/command/suite/select/query_expansion/scalar/column_value.test (+25 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/column_value.test 2012-10-05 13:40:13 +0900 (fcbd0f3) @@ -0,0 +1,25 @@ +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!"] +] + +load --table Synonyms +[ +["_key", "words"], +["groonga", "(groonga OR rroonga OR mroonga)"] +] + +select --table Memos --query_expansion Synonyms.words --query 'content:@groonga' Added: test/command/suite/select/query_expansion/vector/column_value.expected (+64 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/column_value.expected 2012-10-05 13:40:13 +0900 (684f766) @@ -0,0 +1,64 @@ +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!"] +] +[[0,0.0,0.0],4] +load --table Synonyms +[ +["_key", "words"], +["groonga", ["groonga", "rroonga", "mroonga"]] +] +[[0,0.0,0.0],1] +select --table Memos --query_expansion Synonyms.words --query 'content:@groonga' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 3 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 1, + "Start groonga!" + ], + [ + 3, + "Start rroonga!" + ], + [ + 2, + "Start mroonga!" + ] + ] + ] +] Added: test/command/suite/select/query_expansion/vector/column_value.test (+25 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/column_value.test 2012-10-05 13:40:13 +0900 (1ea3d49) @@ -0,0 +1,25 @@ +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!"] +] + +load --table Synonyms +[ +["_key", "words"], +["groonga", ["groonga", "rroonga", "mroonga"]] +] + +select --table Memos --query_expansion Synonyms.words --query 'content:@groonga' Modified: test/unit/core/test-command-select-query-expansion.c (+0 -25) =================================================================== --- test/unit/core/test-command-select-query-expansion.c 2012-10-05 13:36:22 +0900 (c22ebfd) +++ test/unit/core/test-command-select-query-expansion.c 2012-10-05 13:40:13 +0900 (8ed903c) @@ -23,8 +23,6 @@ #include "../lib/grn-assertions.h" -void data_expand_column_value(void); -void test_expand_column_value(gconstpointer data); void data_expand_column_value_with_space(void); void test_expand_column_value_with_space(gconstpointer data); void data_expand_equal(void); @@ -190,29 +188,6 @@ data_scalar_and_vector(void) } void -data_expand_column_value(void) -{ - data_scalar_and_vector(); -} - -void -test_expand_column_value(gconstpointer data) -{ - cut_assert_equal_string( - "[[[2]," - "[[\"_id\",\"UInt32\"]," - "[\"_key\",\"Time\"]," - "[\"content\",\"Text\"]]," - "[3,1315839600.0,\"Start rroonga!\"]," - "[9,1316358000.0,\"Learning Ruby and groonga...\"]]]", - send_command( - cut_take_printf("select Diaries --sortby _id " - "--match_columns content --query 'content:@rroonga' " - "--query_expansion Synonyms.%s", - gcut_data_get_string(data, "column-name")))); -} - -void data_expand_column_value_with_space(void) { data_scalar_and_vector(); -------------- next part -------------- HTML����������������������������...Download