YUKI Hiroshi
null+****@clear*****
Thu Nov 28 17:14:35 JST 2013
YUKI Hiroshi 2013-11-28 17:14:35 +0900 (Thu, 28 Nov 2013) New Revision: 0f12a89ab1251b13cae76e5b4580c41fcd84a816 https://github.com/droonga/fluent-plugin-droonga/commit/0f12a89ab1251b13cae76e5b4580c41fcd84a816 Message: Add test for format conversion on getherer Modified files: test/unit/plugin/collector/test_basic.rb Modified: test/unit/plugin/collector/test_basic.rb (+46 -0) =================================================================== --- test/unit/plugin/collector/test_basic.rb 2013-11-28 17:12:36 +0900 (ec65666) +++ test/unit/plugin/collector/test_basic.rb 2013-11-28 17:14:35 +0900 (c1c2eba) @@ -156,6 +156,52 @@ class BasicCollectorTest < Test::Unit::TestCase "limit" => -1, }, }, + :format_simple => { + :expected => { + "count" => 2, + "records" => [ + create_record(1, 1.1, 1.2), + create_record(2, 2.1, 2.2), + ], + }, + :source => { + "count" => 2, + "records" => [ + create_record(1, 1.1, 1.2), + create_record(2, 2.1, 2.2), + ], + }, + :mapping => { + "output" => "search_result", + "element" => "records", + "format" => "simple", + "attributes" => ["_key", "chapter", "section"], + "limit" => -1, + }, + }, + :format_complex => { + :expected => { + "count" => 2, + "records" => [ + { "_key" => 1, "chapter" => 1.1, "section" => 1.2 }, + { "_key" => 2, "chapter" => 2.1, "section" => 2.2 }, + ], + }, + :source => { + "count" => 2, + "records" => [ + create_record(1, 1.1, 1.2), + create_record(2, 2.1, 2.2), + ], + }, + :mapping => { + "output" => "search_result", + "element" => "records", + "format" => "complex", + "attributes" => ["_key", "chapter", "section"], + "limit" => -1, + }, + }, ) def test_gather(data) request = { -------------- next part -------------- HTML����������������������������...Download