Kouhei Sutou
null+****@clear*****
Wed Jan 13 17:21:18 JST 2016
Kouhei Sutou 2013-09-18 17:10:47 +0900 (Wed, 18 Sep 2013) New Revision: 2e9c670b3599dd1956b71e34f1c787ccf7087784 https://github.com/groonga/groonga-command/commit/2e9c670b3599dd1956b71e34f1c787ccf7087784 Message: Fill all select parameters Modified files: lib/groonga/command/select.rb test/command/test-select.rb Modified: lib/groonga/command/select.rb (+15 -5) =================================================================== --- lib/groonga/command/select.rb 2013-09-18 15:05:44 +0900 (45a7ff4) +++ lib/groonga/command/select.rb 2013-09-18 17:10:47 +0900 (f299ba3) @@ -27,14 +27,24 @@ module Groonga def parameter_names [ :table, - :sortby, - :scorer, + :match_columns, :query, :filter, - :conditions, - :drilldowns, + :scorer, + :sortby, :output_columns, - :output_type, + :offset, + :limit, + :drilldown, + :drilldown_sortby, + :drilldown_output_columns, + :drilldown_offset, + :drilldown_limit, + :cache, + :match_escalation_threshold, + :query_expansion, + :query_flags, + :query_expander, ] end end Modified: test/command/test-select.rb (+63 -2) =================================================================== --- test/command/test-select.rb 2013-09-18 15:05:44 +0900 (c72f76b) +++ test/command/test-select.rb 2013-09-18 17:10:47 +0900 (fd6fd58) @@ -21,10 +21,71 @@ class SelectCommandTest < Test::Unit::TestCase def test_ordered_argument table = "Users" - command = parse("select", [table], :output_type => false) + match_columns = "name * 10 || description" + query = "groonga" + filter = "age >= 18" + scorer = "_score = age" + sortby = "_score" + output_columns = "_key, name" + offset = "10" + limit = "20" + drilldown = "name" + drilldown_sortby = "_nsubrecs" + drilldown_output_columns = "name, _nsubrecs" + drilldown_offset = "5" + drilldown_limit = "10" + cache = "no" + match_escalation_threshold = "-1" + query_expansion = "deprecated" + query_flags = "ALLOW_LEADING_NOT" + query_expander = "Terms.synonym" + command = parse("select", + [ + table, + match_columns, + query, + filter, + scorer, + sortby, + output_columns, + offset, + limit, + drilldown, + drilldown_sortby, + drilldown_output_columns, + drilldown_offset, + drilldown_limit, + cache, + match_escalation_threshold, + query_expansion, + query_flags, + query_expander, + ], + :output_type => false) assert_instance_of(Groonga::Command::Select, command) - assert_equal({:table => table}, command.arguments) + assert_equal({ + :table => table, + :match_columns => match_columns, + :query => query, + :filter => filter, + :scorer => scorer, + :sortby => sortby, + :output_columns => output_columns, + :offset => offset, + :limit => limit, + :drilldown => drilldown, + :drilldown_sortby => drilldown_sortby, + :drilldown_output_columns => drilldown_output_columns, + :drilldown_offset => drilldown_offset, + :drilldown_limit => drilldown_limit, + :cache => cache, + :match_escalation_threshold => match_escalation_threshold, + :query_expansion => query_expansion, + :query_flags => query_flags, + :query_expander => query_expander, + }, + command.arguments) end def test_scorer -------------- next part -------------- HTML����������������������������...ダウンロード