[Groonga-commit] groonga/groonga-command at 9da68f0 [master] test table_create: add key_with_sis predicate

Back to archive index

Kosuke Asami null+****@clear*****
Thu Jul 11 15:36:55 JST 2013


Kosuke Asami	2013-07-11 15:36:55 +0900 (Thu, 11 Jul 2013)

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

  Message:
    test table_create: add key_with_sis predicate

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

  Modified: lib/groonga/command/table-create.rb (+4 -0)
===================================================================
--- lib/groonga/command/table-create.rb    2013-07-11 15:35:03 +0900 (8c7b7c3)
+++ lib/groonga/command/table-create.rb    2013-07-11 15:36:55 +0900 (b1fb11f)
@@ -54,6 +54,10 @@ module Groonga
       def table_dat_key?
         flags.include?("TABLE_DAT_KEY")
       end
+
+      def key_with_sis?
+        flags.include?("KEY_WITH_SIS")
+      end
     end
   end
 end

  Modified: test/command/test-table-create.rb (+17 -0)
===================================================================
--- test/command/test-table-create.rb    2013-07-11 15:35:03 +0900 (d37adb6)
+++ test/command/test-table-create.rb    2013-07-11 15:36:55 +0900 (455255e)
@@ -130,6 +130,23 @@ class TableCreateCommandTest < Test::Unit::TestCase
             assert_equal(data[:expected], command.table_dat_key?)
           end
         end
+
+        class TableKeyWithSisTest < self
+          data({
+              "TABLE_DAT_KEY" => {
+                :expected => true,
+                :flags    => "KEY_WITH_SIS|TABLE_PAT_KEY",
+              },
+              "other flag"   => {
+                :expected => false,
+                :flags    => "TABLE_NO_KEY",
+              }
+            })
+          def test_key_with_sis?(data)
+            command = parse({"flags" => data[:flags]})
+            assert_equal(data[:expected], command.key_with_sis?)
+          end
+        end
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



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