Kouhei Sutou
null+****@clear*****
Fri Oct 5 18:20:17 JST 2012
Kouhei Sutou 2012-10-05 18:20:17 +0900 (Fri, 05 Oct 2012) New Revision: 52d5c139f2614019b059a83ef67fd5defc5d62f2 https://github.com/groonga/groonga/commit/52d5c139f2614019b059a83ef67fd5defc5d62f2 Log: Move Cutter tests to grntest tests Tests for --query_expansion for prefix search ("value*" syntax) is moved. Added files: test/command/suite/select/query_expansion/scalar/prefix.expected test/command/suite/select/query_expansion/scalar/prefix.test test/command/suite/select/query_expansion/vector/prefix.expected test/command/suite/select/query_expansion/vector/prefix.test Modified files: test/unit/core/test-command-select-query-expansion.c Added: test/command/suite/select/query_expansion/scalar/prefix.expected (+59 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/prefix.expected 2012-10-05 18:20:17 +0900 (dbddf87) @@ -0,0 +1,59 @@ +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 TokenBigramSplitAlpha +[[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"], +["groonga"], +["mroonga"], +["groonga storage engine"] +] +[[0,0.0,0.0],3] +load --table Synonyms +[ +["_key", "words"], +["mroon", "groon"] +] +[[0,0.0,0.0],1] +select --table Memos --query_expansion Synonyms.words --match_columns content --query 'mroon*' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 3, + "groonga storage engine" + ], + [ + 1, + "groonga" + ] + ] + ] +] Added: test/command/suite/select/query_expansion/scalar/prefix.test (+26 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/prefix.test 2012-10-05 18:20:17 +0900 (9c180b5) @@ -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 TokenBigramSplitAlpha +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"], +["groonga"], +["mroonga"], +["groonga storage engine"] +] + +load --table Synonyms +[ +["_key", "words"], +["mroon", "groon"] +] + +select --table Memos --query_expansion Synonyms.words \ + --match_columns content --query 'mroon*' Added: test/command/suite/select/query_expansion/vector/prefix.expected (+59 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/prefix.expected 2012-10-05 18:20:17 +0900 (2d924ec) @@ -0,0 +1,59 @@ +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 TokenBigramSplitAlpha +[[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"], +["groonga"], +["mroonga"], +["groonga storage engine"] +] +[[0,0.0,0.0],3] +load --table Synonyms +[ +["_key", "words"], +["mroon", ["groon"]] +] +[[0,0.0,0.0],1] +select --table Memos --query_expansion Synonyms.words --match_columns content --query 'mroon*' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 3, + "groonga storage engine" + ], + [ + 1, + "groonga" + ] + ] + ] +] Added: test/command/suite/select/query_expansion/vector/prefix.test (+26 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/prefix.test 2012-10-05 18:20:17 +0900 (3e7e626) @@ -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 TokenBigramSplitAlpha +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"], +["groonga"], +["mroonga"], +["groonga storage engine"] +] + +load --table Synonyms +[ +["_key", "words"], +["mroon", ["groon"]] +] + +select --table Memos --query_expansion Synonyms.words \ + --match_columns content --query 'mroon*' Modified: test/unit/core/test-command-select-query-expansion.c (+0 -22) =================================================================== --- test/unit/core/test-command-select-query-expansion.c 2012-10-05 18:14:25 +0900 (4a8283e) +++ test/unit/core/test-command-select-query-expansion.c 2012-10-05 18:20:17 +0900 (3d7096d) @@ -186,28 +186,6 @@ data_scalar_and_vector(void) } void -data_expand_prefix(void) -{ - data_scalar_and_vector(); -} - -void -test_expand_prefix(gconstpointer data) -{ - cut_assert_equal_string( - "[[[1]," - "[[\"_id\",\"UInt32\"]," - "[\"_key\",\"Time\"]," - "[\"content\",\"Text\"]]," - "[10,1316444400.0,\"明日は日本語あるいは中国語を勉強します。\"]]]", - send_command( - cut_take_printf("select Diaries --sortby _id " - "--match_columns content --query 'Japan*' " - "--query_expansion Synonyms.%s", - gcut_data_get_string(data, "column-name")))); -} - -void data_not_expand_OR(void) { data_scalar_and_vector(); -------------- next part -------------- HTML����������������������������... Download