[Groonga-commit] droonga/droonga-engine at ee5601f [master] Add test for compatibility to Groonga's column_list (#27)

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 7 17:17:34 JST 2014


YUKI Hiroshi	2014-11-07 17:17:34 +0900 (Fri, 07 Nov 2014)

  New Revision: ee5601f17a4f217745c1115096388ede05921f00
  https://github.com/droonga/droonga-engine/commit/ee5601f17a4f217745c1115096388ede05921f00

  Message:
    Add test for compatibility to Groonga's column_list (#27)

  Modified files:
    test/unit/plugins/groonga/test_column_list.rb

  Modified: test/unit/plugins/groonga/test_column_list.rb (+38 -13)
===================================================================
--- test/unit/plugins/groonga/test_column_list.rb    2014-11-07 16:43:28 +0900 (384575c)
+++ test/unit/plugins/groonga/test_column_list.rb    2014-11-07 17:17:34 +0900 (f6535c5)
@@ -32,6 +32,19 @@ class ColumnListTest < GroongaHandlerTest
                                                        @loop)
   end
 
+  def virtual_key_column(id, table_name)
+    [
+      id,
+      "_key",
+      "",
+      "",
+      "COLUMN_SCALAR",
+      table_name,
+      "ShortText",
+      [],
+    ]
+  end
+
   class HeaderTest < self
     def test_success
       Groonga::Schema.define do |schema|
@@ -166,6 +179,31 @@ class ColumnListTest < GroongaHandlerTest
       ]
       assert_equal(expected, response.last)
     end
+
+    def test_index_source_key
+      Groonga::Schema.define do |schema|
+        schema.create_table("Memos", :type => :patricia_trie)
+        schema.create_table("Terms", :type => :patricia_trie)
+        schema.change_table("Terms") do |table|
+          table.index("Memos", "_key", :name => "index")
+        end
+      end
+      response = process(:column_list,
+                         {"table" => "Terms"})
+      expected = [
+        COLUMNS_HEADER,
+        virtual_key_column(257, "Terms"),
+        [258,
+         "index",
+         @database_path.to_s + ".0000102",
+         "index",
+         "COLUMN_INDEX",
+         "Terms",
+         "Memos",
+         ["Memos"]],
+      ]
+      assert_equal(expected, response.last)
+    end
   end
 
   class VirtualColumnsTest < self
@@ -243,18 +281,5 @@ class ColumnListTest < GroongaHandlerTest
       ]
       assert_equal(expected, response.last)
     end
-
-    def virtual_key_column(id, table_name)
-      [
-        256,
-        "_key",
-        "",
-        "",
-        "COLUMN_SCALAR",
-        "Books",
-        "ShortText",
-        [],
-      ]
-    end
   end
 end
-------------- next part --------------
HTML����������������������������...
下載 



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