YUKI Hiroshi
null+****@clear*****
Thu Nov 28 11:13:08 JST 2013
YUKI Hiroshi 2013-11-28 11:13:08 +0900 (Thu, 28 Nov 2013) New Revision: 76fcc22670dc48c74a4efbe74d46d53b1c48b560 https://github.com/droonga/fluent-plugin-droonga/commit/76fcc22670dc48c74a4efbe74d46d53b1c48b560 Message: Split tests about output offset from output limit Modified files: test/unit/plugin/distributor/test_search.rb Modified: test/unit/plugin/distributor/test_search.rb (+41 -1) =================================================================== --- test/unit/plugin/distributor/test_search.rb 2013-11-28 11:06:57 +0900 (4bd04dc) +++ test/unit/plugin/distributor/test_search.rb 2013-11-28 11:13:08 +0900 (7c62827) @@ -295,8 +295,48 @@ class SearchDistributorTest < Test::Unit::TestCase "format" => "complex", "elements" => ["count", "records"], "attributes" => ["_key", "name", "age"], + "offset" => 0, + "limit" => 1, + }, + }, + }, + }, + } + + @plugin.process("search", envelope) + + message = [] + message << reducer(envelope, { + "count" => { + "type" => "sum", + }, + "records" => { + "type" => "sort", + "order" => ["<"], + "offset" => 0, + "limit" => 1, + }, + }) + message << gatherer(envelope) + message << searcher(envelope, :output_offset => 0, + :output_limit => 1) + assert_equal(message, @posted.last.last) + end + + def test_have_output_offset + envelope = { + "type" => "search", + "dataset" => "Droonga", + "body" => { + "queries" => { + "have_records" => { + "source" => "User", + "output" => { + "format" => "complex", + "elements" => ["count", "records"], + "attributes" => ["_key", "name", "age"], "offset" => 1, - "limit" => 2, + "limit" => 1, }, }, }, -------------- next part -------------- HTML����������������������������...Download