[Groonga-commit] droonga/fluent-plugin-droonga at ca11563 [master] Add test for "count" type mapper

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Dec 4 20:29:43 JST 2013


YUKI Hiroshi	2013-12-04 20:29:43 +0900 (Wed, 04 Dec 2013)

  New Revision: ca115637000fc7eb6c505d9f5e4653ed7194a13d
  https://github.com/droonga/fluent-plugin-droonga/commit/ca115637000fc7eb6c505d9f5e4653ed7194a13d

  Message:
    Add test for "count" type mapper

  Modified files:
    test/unit/plugin/collector/test_basic.rb

  Modified: test/unit/plugin/collector/test_basic.rb (+59 -0)
===================================================================
--- test/unit/plugin/collector/test_basic.rb    2013-12-04 20:25:03 +0900 (7382808)
+++ test/unit/plugin/collector/test_basic.rb    2013-12-04 20:29:43 +0900 (c444b6a)
@@ -226,6 +226,65 @@ class BasicCollectorTest < Test::Unit::TestCase
           },
         },
       },
+      :count_with_records => {
+        :expected => {
+          "count" => 2,
+          "records" => [
+            [],
+            [],
+          ],
+        },
+        :source => {
+          "count" => 5,
+          "records" => [
+            [],
+            [],
+          ],
+        },
+        :mapping => {
+          "output" => "search_result",
+          "elements" => {
+            "count" => {
+              "type" => "count",
+              "target" => "records",
+            },
+            "records" => {
+              "type" => "sort",
+              "format" => "simple",
+              "attributes" => [],
+              "limit" => -1,
+            },
+          },
+        },
+      },
+      :count_only => {
+        :expected => {
+          "count" => 2,
+        },
+        :source => {
+          "count" => 5,
+          "records" => [
+            [],
+            [],
+          ],
+        },
+        :mapping => {
+          "output" => "search_result",
+          "elements" => {
+            "count" => {
+              "type" => "count",
+              "target" => "records",
+              "drop_elements" => ["records"],
+            },
+            "records" => {
+              "type" => "sort",
+              "format" => "simple",
+              "attributes" => [],
+              "limit" => -1,
+            },
+          },
+        },
+      },
     )
     def test_gather(data)
       request = {
-------------- next part --------------
HTML����������������������������...
Télécharger 



More information about the Groonga-commit mailing list
Back to archive index