[Groonga-commit] droonga/fluent-plugin-droonga at e5406d0 [master] Add tests for extra attributes from search keys

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Nov 28 17:12:36 JST 2013


YUKI Hiroshi	2013-11-28 17:12:36 +0900 (Thu, 28 Nov 2013)

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

  Message:
    Add tests for extra attributes from search keys

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

  Modified: test/unit/plugin/collector/test_basic.rb (+45 -1)
===================================================================
--- test/unit/plugin/collector/test_basic.rb    2013-11-28 17:12:22 +0900 (642f82e)
+++ test/unit/plugin/collector/test_basic.rb    2013-11-28 17:12:36 +0900 (ec65666)
@@ -33,7 +33,7 @@ class BasicCollectorTest < Test::Unit::TestCase
     columns
   end
 
-  class < self
+  class << self
     def create_record(*columns)
       columns
     end
@@ -112,6 +112,50 @@ class BasicCollectorTest < Test::Unit::TestCase
           "limit" => -1,
         },
       },
+      :attributes => {
+        :expected => {
+          "count" => 2,
+          "records" => [
+            create_record(1, 1.1, 1.2, 1.3, 1.4),
+            create_record(2, 2.1, 2.2, 2.3, 2.4),
+          ],
+        },
+        :source => {
+          "count" => 2,
+          "records" => [
+            create_record(1, 1.1, 1.2, 1.3, 1.4),
+            create_record(2, 2.1, 2.2, 2.3, 2.4),
+          ],
+        },
+        :mapping => {
+          "output" => "search_result",
+          "element" => "records",
+          "attributes" => ["_key", "chapter", "section", "subsection", "paragraph"],
+          "limit" => -1,
+        },
+      },
+      :attributes_with_sort_attributes => {
+        :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, 1.3, 1.4),
+            create_record(2, 2.1, 2.2, 2.3, 2.4),
+          ],
+        },
+        :mapping => {
+          "output" => "search_result",
+          "element" => "records",
+          "attributes" => ["_key", "chapter", "section"],
+          "limit" => -1,
+        },
+      },
     )
     def test_gather(data)
       request = {
-------------- next part --------------
HTML����������������������������...
Download 



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