[Groonga-commit] droonga/fluent-plugin-droonga at 359d612 [master] Add a test case for _key for index source

Back to archive index

Yoji Shidara null+****@clear*****
Thu Feb 27 13:29:08 JST 2014


Yoji Shidara	2014-02-27 13:29:08 +0900 (Thu, 27 Feb 2014)

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

  Message:
    Add a test case for _key for index source

  Modified files:
    test/unit/catalog/test_schema.rb

  Modified: test/unit/catalog/test_schema.rb (+53 -0)
===================================================================
--- test/unit/catalog/test_schema.rb    2014-02-27 13:23:44 +0900 (dcb6efe)
+++ test/unit/catalog/test_schema.rb    2014-02-27 13:29:08 +0900 (3bad6b3)
@@ -32,6 +32,59 @@ class CatalogSchemaTest < Test::Unit::TestCase
                    create_schema({}).to_messages)
     end
 
+    def test_key_index
+      assert_equal([
+                     {
+                       "type" => "table_create",
+                       "body" => {
+                         "name"       => "Term",
+                         "key_type"   => "ShortText",
+                         "flags"      => "TABLE_PAT_KEY",
+                         "normalizer" => "NormalizerAuto",
+                       }
+                     },
+                     {
+                       "type" => "table_create",
+                       "body" => {
+                         "name"       => "Store",
+                         "key_type"   => "ShortText",
+                         "flags"      => "TABLE_HASH_KEY",
+                       }
+                     },
+                     {
+                       "type" => "column_create",
+                       "body" => {
+                         "name"       => "stores__key",
+                         "table"      => "Term",
+                         "type"       => "Store",
+                         "flags"      => "COLUMN_INDEX",
+                         "source"     => "_key"
+                       }
+                     }
+                   ],
+                   create_schema(
+                     "Term" => {
+                       "type"       => "PatriciaTrie",
+                       "keyType"    => "ShortText",
+                       "normalizer" => "NormalizerAuto",
+                       "columns" => {
+                         "stores__key" => {
+                           "type"      => "Index",
+                           "valueType" => "Store",
+                           "indexOptions" => {
+                             "sources" => [
+                               "_key"
+                             ]
+                           }
+                         }
+                       }
+                     },
+                     "Store" => {
+                       "keyType" => "ShortText"
+                     }
+                   ).to_messages)
+    end
+
 =begin
     def test_integration
       assert_equal([
-------------- next part --------------
HTML����������������������������...
Download 



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