[Groonga-commit] groonga/groonga-command at b876e20 [master] column_create: add with_section predicate

アーカイブの一覧に戻る

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


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

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

  Message:
    column_create: add with_section 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:27:45 +0900 (d35e8db)
+++ lib/groonga/command/column-create.rb    2013-07-16 13:29:45 +0900 (2c3d209)
@@ -50,6 +50,10 @@ module Groonga
       def column_index?
         flags.include?("COLUMN_INDEX")
       end
+
+      def with_section?
+        flags.include?("WITH_SECTION")
+      end
     end
   end
 end

  Modified: test/command/test-column-create.rb (+15 -0)
===================================================================
--- test/command/test-column-create.rb    2013-07-16 13:27:45 +0900 (f074e30)
+++ test/command/test-column-create.rb    2013-07-16 13:29:45 +0900 (084bffa)
@@ -107,6 +107,21 @@ class ColumnCreateCommandTest < Test::Unit::TestCase
           command = parse({"flags" => data[:flags]})
           assert_equal(data[:expected], command.column_index?)
         end
+
+        data({
+               "WITH_SECTION" => {
+                 :expected => true,
+                 :flags    => "COLUMN_INDEX|WITH_SECTION",
+               },
+               "other flag"   => {
+                 :expected => false,
+                 :flags    => "COLUMN_INDEX|WITH_WEIGHT",
+               }
+             })
+        def test_with_section?(data)
+          command = parse({"flags" => data[:flags]})
+          assert_equal(data[:expected], command.with_section?)
+        end
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
ダウンロード 



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