Kosuke Asami
null+****@clear*****
Thu Jul 11 15:33:01 JST 2013
Kosuke Asami 2013-07-11 15:33:01 +0900 (Thu, 11 Jul 2013) New Revision: 5c9f85503e6cee398fc26df3e61b0ec3059fca5b https://github.com/groonga/groonga-command/commit/5c9f85503e6cee398fc26df3e61b0ec3059fca5b Message: test table_create: add table_hash_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:31:22 +0900 (73aaab3) +++ lib/groonga/command/table-create.rb 2013-07-11 15:33:01 +0900 (b7c1698) @@ -42,6 +42,10 @@ module Groonga def table_no_key? flags.include?("TABLE_NO_KEY") end + + def table_hash_key? + flags.include?("TABLE_HASH_KEY") + end end end end Modified: test/command/test-table-create.rb (+17 -0) =================================================================== --- test/command/test-table-create.rb 2013-07-11 15:31:22 +0900 (7b96896) +++ test/command/test-table-create.rb 2013-07-11 15:33:01 +0900 (f9267c4) @@ -79,6 +79,23 @@ class TableCreateCommandTest < Test::Unit::TestCase assert_equal(data[:expected], command.table_no_key?) end end + + class TableHashKeyTest < self + data({ + "TABLE_HASH_KEY" => { + :expected => true, + :flags => "TABLE_HASH_KEY", + }, + "other flag" => { + :expected => false, + :flags => "TABLE_PAT_KEY", + } + }) + def test_table_hash_key?(data) + command = parse({"flags" => data[:flags]}) + assert_equal(data[:expected], command.table_hash_key?) + end + end end end end -------------- next part -------------- HTML����������������������������...Download