[Groonga-commit] groonga/groonga-command at 9eee51b [master] column_create: add column_index predicate

Back to archive index

Kosuke Asami null+****@clear*****
Tue Jul 16 13:27:45 JST 2013


Kosuke Asami	2013-07-16 13:27:45 +0900 (Tue, 16 Jul 2013)

  New Revision: 9eee51b6d8703ad2832ca36e6a23b30621f914bd
  https://github.com/groonga/groonga-command/commit/9eee51b6d8703ad2832ca36e6a23b30621f914bd

  Message:
    column_create: add column_index 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:26:30 +0900 (8487803)
+++ lib/groonga/command/column-create.rb    2013-07-16 13:27:45 +0900 (d35e8db)
@@ -46,6 +46,10 @@ module Groonga
       def column_vector?
         flags.include?("COLUMN_VECTOR")
       end
+
+      def column_index?
+        flags.include?("COLUMN_INDEX")
+      end
     end
   end
 end

  Modified: test/command/test-column-create.rb (+15 -0)
===================================================================
--- test/command/test-column-create.rb    2013-07-16 13:26:30 +0900 (fb88af0)
+++ test/command/test-column-create.rb    2013-07-16 13:27:45 +0900 (f074e30)
@@ -92,6 +92,21 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
           command = parse({"flags" => data[:flags]})
           assert_equal(data[:expected], command.column_vector?)
         end
+
+        data({
+               "COLUMN_INDEX" => {
+                 :expected => true,
+                 :flags    => "COLUMN_INDEX",
+               },
+               "other flag"   => {
+                 :expected => false,
+                 :flags    => "COLUMN_SCALAR",
+               }
+             })
+        def test_column_index?(data)
+          command = parse({"flags" => data[:flags]})
+          assert_equal(data[:expected], command.column_index?)
+        end
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Télécharger 



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