[Groonga-commit] groonga/groonga-command at 4bfb5ed [master] column_create: add column_vector predicate

アーカイブの一覧に戻る

Kosuke Asami null+****@clear*****
Tue Jul 16 13:26:30 JST 2013


Kosuke Asami	2013-07-16 13:26:30 +0900 (Tue, 16 Jul 2013)

  New Revision: 4bfb5edc1bb3d7d3fcf89699e1c10292a0158af5
  https://github.com/groonga/groonga-command/commit/4bfb5edc1bb3d7d3fcf89699e1c10292a0158af5

  Message:
    column_create: add column_vector predicate

  Modified files:
    lib/groonga/command/column-create.rb
    test/command/test-column-create.rb

  Modified: lib/groonga/command/column-create.rb (+4 -0)
===================================================================
--- lib/groonga/command/column-create.rb    2013-07-16 13:24:03 +0900 (2dbc4bc)
+++ lib/groonga/command/column-create.rb    2013-07-16 13:26:30 +0900 (8487803)
@@ -42,6 +42,10 @@ module Groonga
       def column_scalar?
         flags.include?("COLUMN_SCALAR")
       end
+
+      def column_vector?
+        flags.include?("COLUMN_VECTOR")
+      end
     end
   end
 end

  Modified: test/command/test-column-create.rb (+15 -0)
===================================================================
--- test/command/test-column-create.rb    2013-07-16 13:24:03 +0900 (46dbadb)
+++ test/command/test-column-create.rb    2013-07-16 13:26:30 +0900 (fb88af0)
@@ -77,6 +77,21 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
           command = parse({"flags" => data[:flags]})
           assert_equal(data[:expected], command.column_scalar?)
         end
+
+        data({
+               "COLUMN_VECTOR" => {
+                 :expected => true,
+                 :flags    => "COLUMN_VECTOR",
+               },
+               "other flag"   => {
+                 :expected => false,
+                 :flags    => "COLUMN_INDEX",
+               }
+             })
+        def test_column_vector?(data)
+          command = parse({"flags" => data[:flags]})
+          assert_equal(data[:expected], command.column_vector?)
+        end
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る