Susumu Yata
null+****@clear*****
Thu Apr 13 19:38:52 JST 2017
Susumu Yata 2017-04-13 19:38:52 +0900 (Thu, 13 Apr 2017) New Revision: 5256b31d63a8b57ed78afefe2761fc3274105589 https://github.com/groonga/groonga/commit/5256b31d63a8b57ed78afefe2761fc3274105589 Message: test: use sort_keys instead of sortby in unit tests. Modified files: test/unit/core/test-command-select-sort.c test/unit/core/test-command-select.c test/unit/core/test-command-truncate.c test/unit/core/test-function-edit-distance.c test/unit/story/test-taiyaki.c Modified: test/unit/core/test-command-select-sort.c (+10 -10) =================================================================== --- test/unit/core/test-command-select-sort.c 2017-04-13 11:52:43 +0900 (3f25498) +++ test/unit/core/test-command-select-sort.c 2017-04-13 19:38:52 +0900 (b05204d) @@ -156,7 +156,7 @@ test_int(void) "[\"groonga.org\",100,2]," "[\"2ch.net\",10,11]]]", send_command("select Sites " - "--sortby \"-score, -age\" " + "--sort_keys \"-score, -age\" " "--output_columns \"_key, score, age\"")); } @@ -193,10 +193,10 @@ test_drilldown(void) "[100,2]]]", send_command("select Bookmarks " "--output_columns \"site._key, user._key, rank\" " - "--sortby \"-site.score, -site.age\" " + "--sort_keys \"-site.score, -site.age\" " "--drilldown \"site, user, rank\" " "--drilldown_output_columns \"_key, _nsubrecs\" " - "--drilldown_sortby \"_key\"")); + "--drilldown_sort_keys \"_key\"")); } void @@ -209,7 +209,7 @@ test_score_without_query(void) "[\"groonga.org\"]," "[\"qwik.jp/senna/FrontPageJ.html\"]]]", send_command("select Sites " - "--sortby \"_score\" " + "--sort_keys \"_score\" " "--output_columns \"_key\"")); } @@ -245,11 +245,11 @@ test_score_drilldown_without_query(void) "[50,1]," "[100,2]]]", send_command("select Bookmarks " - "--sortby \"_score,-_id\" " + "--sort_keys \"_score,-_id\" " "--output_columns \"_id, site._key, user._key\" " "--drilldown \"site user rank\" " "--drilldown_output_columns \"_key, _nsubrecs\" " - "--drilldown_sortby \"_key\"")); + "--drilldown_sort_keys \"_key\"")); } void @@ -261,7 +261,7 @@ test_nonexistent(void) "[select][sort] failed to parse: <_score,nonexistent>: " "invalid sort key: <nonexistent>: table:<Sites> keys:<_score,nonexistent>", "select Sites " - "--sortby \"_score,nonexistent\" " + "--sort_keys \"_score,nonexistent\" " "--output_columns \"_key\""); } @@ -276,7 +276,7 @@ test_fulltext_search_index_with_query(void) "[\"groonga.org\"," "\"fulltext search engine and column store\"]]]", send_command("select Sites " - "--sortby \"description\" " + "--sort_keys \"description\" " "--output_columns \"_key, description\" " "--match_columns \"description\" " "--query \"fulltext\"")); @@ -305,7 +305,7 @@ test_pat_integer_index_with_query(void) "[5,\"qwik.jp/senna/FrontPageJ.html\"]," "[11,\"2ch.net\"]]]", send_command("select Sites " - "--sortby \"age\" " + "--sort_keys \"age\" " "--output_columns \"age, _key\" " "--match_columns \"description\" " "--query \"fulltext OR BBS OR groonga\"")); @@ -334,6 +334,6 @@ test_pat_integer_index_without_query(void) "[5,\"qwik.jp/senna/FrontPageJ.html\"]," "[11,\"2ch.net\"]]]", send_command("select Sites " - "--sortby \"age\" " + "--sort_keys \"age\" " "--output_columns \"age, _key\"")); } Modified: test/unit/core/test-command-select.c (+3 -3) =================================================================== --- test/unit/core/test-command-select.c 2017-04-13 11:52:43 +0900 (8fd01d6) +++ test/unit/core/test-command-select.c 2017-04-13 19:38:52 +0900 (24054d1) @@ -463,7 +463,7 @@ test_less_than(gconstpointer data) "[\"groonga.org\",5]]]", type), send_command("select Sites " - "--sortby -score " + "--sort_keys -score " "--output_columns _key,score " "--filter 'score > 4'")); } @@ -515,7 +515,7 @@ test_less_than_or_equal(gconstpointer data) "[\"ruby-lang.org\",4]]]", type), send_command("select Sites " - "--sortby -score " + "--sort_keys -score " "--output_columns _key,score " "--filter 'score >= 4'")); } @@ -566,7 +566,7 @@ test_equal_numeric(gconstpointer data) "[\"ruby-lang.org\",4]]]", type), send_command("select Sites " - "--sortby -score " + "--sort_keys -score " "--output_columns _key,score " "--filter 'score == 4'")); } Modified: test/unit/core/test-command-truncate.c (+1 -1) =================================================================== --- test/unit/core/test-command-truncate.c 2017-04-13 11:52:43 +0900 (c42cb01) +++ test/unit/core/test-command-truncate.c 2017-04-13 19:38:52 +0900 (f15f28d) @@ -123,7 +123,7 @@ test_have_columns(void) "[1,\"mori\",\"Daijiro MORI\"]," "[2,\"gunyara-kun\",\"Tasuku SUENAGA\"]," "[3,\"yu\",\"Yutaro Shimamura\"]]]", - send_command("select Users --sortby _id")); + send_command("select Users --sort_keys _id")); cut_assert_equal_string("true", send_command("truncate Users")); cut_assert_equal_string( Modified: test/unit/core/test-function-edit-distance.c (+2 -2) =================================================================== --- test/unit/core/test-function-edit-distance.c 2017-04-13 11:52:43 +0900 (d891c8f) +++ test/unit/core/test-function-edit-distance.c 2017-04-13 19:38:52 +0900 (7efc9e7) @@ -152,7 +152,7 @@ test_alphabet(gconstpointer data) command = cut_take_printf("select Users " "--output_columns name,_score " "--filter true " - "--sortby _score,name " + "--sort_keys _score,name " "--scorer '_score=edit_distance(name, \"%s\")'", gcut_data_get_string(data, "string")); @@ -233,7 +233,7 @@ test_japanese(gconstpointer data) command = cut_take_printf("select Users " "--output_columns name,_score " "--filter true " - "--sortby _score,name " + "--sort_keys _score,name " "--scorer '_score=edit_distance(name, \"%s\")'", gcut_data_get_string(data, "string")); Modified: test/unit/story/test-taiyaki.c (+13 -13) =================================================================== --- test/unit/story/test-taiyaki.c 2017-04-13 11:52:43 +0900 (119f5be) +++ test/unit/story/test-taiyaki.c 2017-04-13 19:38:52 +0900 (5b0337b) @@ -117,7 +117,7 @@ test_in_circle(void) send_command( cut_take_printf( "select Shops " - "--sortby '+_score, +name' " + "--sort_keys '+_score, +name' " "--output_columns 'name, _score, location' " "--filter 'geo_in_circle(location, \"%s\", %d)' " "--scorer '_score=geo_distance(location, \"%s\")'", @@ -147,7 +147,7 @@ test_sort(void) send_command( cut_take_printf( "select Shops " - "--sortby 'geo_distance(location, \"%s\")' " + "--sort_keys 'geo_distance(location, \"%s\")' " "--output_columns 'name, _score' " "--filter 'geo_in_circle(location, \"%s\", %d)' " "--scorer '_score=geo_distance(location, \"%s\")'", @@ -180,7 +180,7 @@ test_filter_by_tag_and_sort_by_distance_from_tokyo_tocho(void) send_command( cut_take_printf( "select Shops " - "--sortby '+_score, +name' " + "--sort_keys '+_score, +name' " "--output_columns 'name, _score' " "--filter 'tags @ \"たいやき\"' " "--scorer '_score=geo_distance2(location, \"%s\")'", @@ -206,7 +206,7 @@ test_in_circle_and_tag(void) send_command( cut_take_printf( "select Shops " - "--sortby '+_score, +name' " + "--sort_keys '+_score, +name' " "--output_columns 'name, _score' " "--filter 'geo_in_circle(location, \"%s\", %d) && tags @ \"たいやき\"' " "--scorer '_score=geo_distance3(location, \"%s\")'", @@ -234,7 +234,7 @@ test_but_white(void) send_command( cut_take_printf( "select Shops " - "--sortby '+_score, +name' " + "--sort_keys '+_score, +name' " "--output_columns 'name, _score' " "--filter '" \ "geo_in_circle(location, \"%s\", %d) && " \ @@ -293,13 +293,13 @@ test_drilldown(void) send_command( cut_take_printf( "select Shops " - "--sortby '+_score, +name' " + "--sort_keys '+_score, +name' " "--output_columns 'name, _score' " "--filter 'geo_in_circle(location, \"%s\", %d) && tags @ \"たいやき\"' " "--scorer '_score=geo_distance2(location, \"%s\")' " "--drilldown 'tags categories area' " "--drilldown_output_columns '_key, name, _nsubrecs' " - "--drilldown_sortby '_key'", + "--drilldown_sort_keys '_key'", grn_test_location_string(yurakucho_latitude, yurakucho_longitude), distance, grn_test_location_string(yurakucho_latitude, yurakucho_longitude)))); @@ -336,13 +336,13 @@ test_drilldown_with_broken_reference(void) send_command( cut_take_printf( "select Shops " - "--sortby '+_score, +name' " + "--sort_keys '+_score, +name' " "--output_columns 'name, _score' " "--filter 'geo_in_circle(location, \"%s\", %d) && tags @ \"たいやき\"' " "--scorer '_score=geo_distance3(location, \"%s\")' " "--drilldown 'area' " "--drilldown_output_columns '_key, name, _nsubrecs' " - "--drilldown_sortby '_key'", + "--drilldown_sort_keys '_key'", grn_test_location_string(yurakucho_latitude, yurakucho_longitude), distance, grn_test_location_string(yurakucho_latitude, yurakucho_longitude)))); @@ -381,14 +381,14 @@ test_weight_match(void) send_command( cut_take_printf( "select Shops " - "--sortby '-_score, +name' " + "--sort_keys '-_score, +name' " "--output_columns 'name, _score' " "--match_columns 'name * 1000 || tags * 10000' " "--query たいやき " "--filter 'geo_in_circle(location, \"%s\", %d)' " "--scorer '_score -= geo_distance(location, \"%s\")' " "--drilldown_output_columns '_key, _nsubrecs' " - "--drilldown_sortby '-_nsubrecs' " + "--drilldown_sort_keys '-_nsubrecs' " "--drilldown 'tags' ", grn_test_location_string(yurakucho_latitude, yurakucho_longitude), distance, @@ -410,7 +410,7 @@ test_multi_geo_in_circle(void) send_command( cut_take_printf( "select Shops " - "--sortby '-_score, +name' " + "--sort_keys '-_score, +name' " "--output_columns 'name, _score' " "--match_columns 'name * 1000 || tags * 10000' " "--query たいやき " @@ -440,7 +440,7 @@ test_query_expansion(void) "]]", send_command( "select Shops " - "--sortby '+name' " + "--sort_keys '+name' " "--output_columns 'name' " "--limit 3 " "--match_columns name " -------------- next part -------------- HTML����������������������������... 下載