Kosuke Asami
null+****@clear*****
Thu Jul 11 15:34:10 JST 2013
Kosuke Asami 2013-07-11 15:34:10 +0900 (Thu, 11 Jul 2013) New Revision: b5ce89db787e5fe9a0feb5f45f5e0ce8bab2d064 https://github.com/groonga/groonga-command/commit/b5ce89db787e5fe9a0feb5f45f5e0ce8bab2d064 Message: test table_create: add table_pat_key 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:33:01 +0900 (b7c1698) +++ lib/groonga/command/table-create.rb 2013-07-11 15:34:10 +0900 (69304c5) @@ -46,6 +46,10 @@ module Groonga def table_hash_key? flags.include?("TABLE_HASH_KEY") end + + def table_pat_key? + flags.include?("TABLE_PAT_KEY") + end end end end Modified: test/command/test-table-create.rb (+17 -0) =================================================================== --- test/command/test-table-create.rb 2013-07-11 15:33:01 +0900 (f9267c4) +++ test/command/test-table-create.rb 2013-07-11 15:34:10 +0900 (ec7b395) @@ -96,6 +96,23 @@ class TableCreateCommandTest < Test::Unit::TestCase assert_equal(data[:expected], command.table_hash_key?) end end + + class TablePatKeyTest < self + data({ + "TABLE_PAT_KEY" => { + :expected => true, + :flags => "TABLE_PAT_KEY", + }, + "other flag" => { + :expected => false, + :flags => "TABLE_DAT_KEY", + } + }) + def test_table_pat_key?(data) + command = parse({"flags" => data[:flags]}) + assert_equal(data[:expected], command.table_pat_key?) + end + end end end end -------------- next part -------------- HTML����������������������������...Download