Kouhei Sutou
null+****@clear*****
Tue Oct 9 11:43:33 JST 2012
Kouhei Sutou 2012-10-09 11:43:33 +0900 (Tue, 09 Oct 2012) New Revision: 3b1c4b7dcb8e753e078fdd5e608c678475592a03 https://github.com/groonga/groonga/commit/3b1c4b7dcb8e753e078fdd5e608c678475592a03 Log: Move Cutter tests to grntest tests Tests for --query_expansion "(...)" is moved. Added files: test/command/suite/select/query_expansion/scalar/parenthesis.expected test/command/suite/select/query_expansion/scalar/parenthesis.test test/command/suite/select/query_expansion/vector/parenthesis.expected test/command/suite/select/query_expansion/vector/parenthesis.test Modified files: test/unit/core/test-command-select-query-expansion.c Added: test/command/suite/select/query_expansion/scalar/parenthesis.expected (+60 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/parenthesis.expected 2012-10-09 11:43:33 +0900 (3109c2f) @@ -0,0 +1,60 @@ +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!"], +["Open groonga database and close it."] +] +[[0,0.0,0.0],3] +load --table Synonyms +[ +["_key", "words"], +["(", "open"] +[")", "close"] +] +[[0,0.0,0.0],2] +select --table Memos --query_expansion Synonyms.words --match_columns content --query '(groonga)' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 1, + "Start groonga!" + ], + [ + 3, + "Open groonga database and close it." + ] + ] + ] +] Added: test/command/suite/select/query_expansion/scalar/parenthesis.test (+26 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/scalar/parenthesis.test 2012-10-09 11:43:33 +0900 (fff5c48) @@ -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!"], +["Open groonga database and close it."] +] + +load --table Synonyms +[ +["_key", "words"], +["(", "open"] +[")", "close"] +] + +select --table Memos --query_expansion Synonyms.words \ + --match_columns content --query '(groonga)' Added: test/command/suite/select/query_expansion/vector/parenthesis.expected (+60 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/parenthesis.expected 2012-10-09 11:43:33 +0900 (d096edc) @@ -0,0 +1,60 @@ +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!"], +["Open groonga database and close it."] +] +[[0,0.0,0.0],3] +load --table Synonyms +[ +["_key", "words"], +["(", ["open"]] +[")", ["close"]] +] +[[0,0.0,0.0],2] +select --table Memos --query_expansion Synonyms.words --match_columns content --query '(groonga)' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "content", + "ShortText" + ] + ], + [ + 1, + "Start groonga!" + ], + [ + 3, + "Open groonga database and close it." + ] + ] + ] +] Added: test/command/suite/select/query_expansion/vector/parenthesis.test (+26 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/query_expansion/vector/parenthesis.test 2012-10-09 11:43:33 +0900 (38d4cc5) @@ -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!"], +["Open groonga database and close it."] +] + +load --table Synonyms +[ +["_key", "words"], +["(", ["open"]] +[")", ["close"]] +] + +select --table Memos --query_expansion Synonyms.words \ + --match_columns content --query '(groonga)' Modified: test/unit/core/test-command-select-query-expansion.c (+0 -23) =================================================================== --- test/unit/core/test-command-select-query-expansion.c 2012-10-09 11:28:00 +0900 (1e36fb8) +++ test/unit/core/test-command-select-query-expansion.c 2012-10-09 11:43:33 +0900 (79e31b6) @@ -186,29 +186,6 @@ data_scalar_and_vector(void) } void -data_not_expand_paren(void) -{ - data_scalar_and_vector(); -} - -void -test_not_expand_paren(gconstpointer data) -{ - cut_assert_equal_string( - "[[[2]," - "[[\"_id\",\"UInt32\"]," - "[\"_key\",\"Time\"]," - "[\"content\",\"Text\"]]," - "[4,1315926000.0,\"Start Ruby!\"]," - "[9,1316358000.0,\"Learning Ruby and groonga...\"]]]", - send_command( - cut_take_printf("select Diaries --sortby _id " - "--match_columns content --query '(Ruby)' " - "--query_expansion Synonyms.%s", - gcut_data_get_string(data, "column-name")))); -} - -void data_no_expand(void) { data_scalar_and_vector(); -------------- next part -------------- HTML����������������������������...Download