[Groonga-commit] droonga/droonga-engine at af71559 [master] Add unit test for virtual _key column

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Nov 7 15:23:39 JST 2014


YUKI Hiroshi	2014-11-07 15:23:39 +0900 (Fri, 07 Nov 2014)

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

  Message:
    Add unit test for virtual _key column

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

  Modified: test/unit/plugins/groonga/test_column_list.rb (+32 -0)
===================================================================
--- test/unit/plugins/groonga/test_column_list.rb    2014-11-07 15:18:37 +0900 (52202b0)
+++ test/unit/plugins/groonga/test_column_list.rb    2014-11-07 15:23:39 +0900 (7babaa5)
@@ -135,6 +135,38 @@ class ColumnListTest < GroongaHandlerTest
       assert_equal(expected, response.last)
     end
 
+    def test_with_key
+      Groonga::Schema.define do |schema|
+        schema.create_table("Books", :type => :hash,
+                                     :key_type => "ShortText")
+        schema.change_table("Books") do |table|
+          table.column("age", "UInt32", :type => :scalar)
+        end
+      end
+      response = process(:column_list,
+                         {"table" => "Books"})
+      expected = [
+        COLUMNS_HEADER,
+        [257,
+         "_key",
+         "",
+         "",
+         "COLUMN_SCALAR",
+         "Books",
+         "ShortText",
+         []],
+        [258,
+         "age",
+         @database_path.to_s + ".0000101",
+         "fix",
+         "COLUMN_SCALAR",
+         "Books",
+         "UInt32",
+         []],
+      ]
+      assert_equal(expected, response.last)
+    end
+
     def test_index
       Groonga::Schema.define do |schema|
         schema.create_table("Books", :type => :hash)
-------------- next part --------------
HTML����������������������������...
Download 



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