Kouhei Sutou
null+****@clear*****
Wed Apr 8 15:59:17 JST 2015
Kouhei Sutou 2015-04-08 15:59:17 +0900 (Wed, 08 Apr 2015) New Revision: fae22fb014959832eaba39f709e904079f746442 https://github.com/groonga/groonga/commit/fae22fb014959832eaba39f709e904079f746442 Message: test: migrate Cutter test for nonexistent key equal to grntest Added files: test/command/suite/select/filter/no_index/equal/nonexistent_reference_record.expected test/command/suite/select/filter/no_index/equal/nonexistent_reference_record.test Modified files: test/unit/core/test-table-select.c Added: test/command/suite/select/filter/no_index/equal/nonexistent_reference_record.expected (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/filter/no_index/equal/nonexistent_reference_record.expected 2015-04-08 15:59:17 +0900 (64006e9) @@ -0,0 +1,48 @@ +table_create Bookmarks TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Bookmarks title COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +table_create Users TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Users bookmark COLUMN_SCALAR Bookmarks +[[0,0.0,0.0],true] +load --table Bookmarks +[ +{"_key": "http://groonga.org/", "title": "Groonga"} +] +[[0,0.0,0.0],1] +load --table Users +[ +{"_key": "alice", "bookmark": "http://groonga.org/"}, +{"_key": "bob"} +] +[[0,0.0,0.0],2] +select Users --filter 'bookmark == "http://nonexistent.example.com/"' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 0 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "bookmark", + "Bookmarks" + ] + ] + ] + ] +] Added: test/command/suite/select/filter/no_index/equal/nonexistent_reference_record.test (+18 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/filter/no_index/equal/nonexistent_reference_record.test 2015-04-08 15:59:17 +0900 (fb046c5) @@ -0,0 +1,18 @@ +table_create Bookmarks TABLE_HASH_KEY ShortText +column_create Bookmarks title COLUMN_SCALAR ShortText + +table_create Users TABLE_HASH_KEY ShortText +column_create Users bookmark COLUMN_SCALAR Bookmarks + +load --table Bookmarks +[ +{"_key": "http://groonga.org/", "title": "Groonga"} +] + +load --table Users +[ +{"_key": "alice", "bookmark": "http://groonga.org/"}, +{"_key": "bob"} +] + +select Users --filter 'bookmark == "http://nonexistent.example.com/"' Modified: test/unit/core/test-table-select.c (+0 -21) =================================================================== --- test/unit/core/test-table-select.c 2015-04-08 11:31:03 +0900 (45211af) +++ test/unit/core/test-table-select.c 2015-04-08 15:59:17 +0900 (4d214ef) @@ -35,7 +35,6 @@ static grn_obj text_buf, int_buf, ptr_buf; void test_equal(void); void test_equal_indexed(void); void test_equal_by_existent_reference_key(void); -void test_equal_by_nonexistent_reference_key(void); void test_select(void); void test_search(void); void test_select_search(void); @@ -289,26 +288,6 @@ test_equal_by_existent_reference_key(void) } void -test_equal_by_nonexistent_reference_key(void) -{ - grn_obj *v; - - prepare_data(); - - GRN_EXPR_CREATE_FOR_QUERY(&context, docs, cond, v); - cut_assert_not_null(cond); - cut_assert_not_null(v); - PARSE(cond, "author == \"nonexistent\"", GRN_EXPR_SYNTAX_SCRIPT); - res = grn_table_select(&context, docs, cond, NULL, GRN_OP_OR); - cut_assert_not_null(res); - - grn_test_assert_select(&context, - NULL, - res, - "body"); -} - -void test_select(void) { grn_obj *v; -------------- next part -------------- HTML����������������������������... Download