[Groonga-commit] droonga/fluent-plugin-droonga at dfad9bb [master] Add test for converting of multiple commands in once

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Sep 18 14:56:49 JST 2013


YUKI Hiroshi	2013-09-18 14:56:49 +0900 (Wed, 18 Sep 2013)

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

  Message:
    Add test for converting of multiple commands in once

  Modified files:
    test/test_groonga_command_converter.rb

  Modified: test/test_groonga_command_converter.rb (+43 -0)
===================================================================
--- test/test_groonga_command_converter.rb    2013-09-18 13:26:53 +0900 (d3e7662)
+++ test/test_groonga_command_converter.rb    2013-09-18 14:56:49 +0900 (9a4c332)
@@ -167,6 +167,49 @@ class GroongaCommandConverterTest < Test::Unit::TestCase
                  results)
   end
 
+  def test_multiple_commands
+    results = []
+    command = "table_create Terms TABLE_PAT_KEY ShortText " +
+                "--default_tokenizer TokenBigram --normalizer NormalizerAuto\n" +
+                "column_create Terms Users_name COLUMN_INDEX|WITH_POSITION Users name"
+    @converter.convert(command) do |droonga_command|
+      results << droonga_command
+    end
+    assert_equal([
+                   {
+                     :id => "test:0",
+                     :date => formatted_date,
+                     :replyTo => reply_to,
+                     :statusCode => status_code,
+                     :dataset => dataset,
+                     :type => "table_create",
+                     :body => {
+                       :name => "Terms",
+                       :flags => "TABLE_PAT_KEY",
+                       :key_type => "ShortText",
+                       :default_tokenizer => "TokenBigram",
+                       :normalizer => "NormalizerAuto",
+                     },
+                   },
+                   {
+                     :id => "test:1",
+                     :date => formatted_date,
+                     :replyTo => reply_to,
+                     :statusCode => status_code,
+                     :dataset => dataset,
+                     :type => "column_create",
+                     :body => {
+                       :table => "Terms",
+                       :name => "Users_name",
+                       :flags => "COLUMN_INDEX|WITH_POSITION",
+                       :type => "Users",
+                       :source => "name",
+                     },
+                   },
+                 ],
+                 results)
+  end
+
   private
   def date
     Time.new(2013, 11, 29, 0, 0, 0)
-------------- next part --------------
HTML����������������������������...
Download 



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