Kosuke Asami
null+****@clear*****
Thu Jul 11 15:35:03 JST 2013
Kosuke Asami 2013-07-11 15:35:03 +0900 (Thu, 11 Jul 2013) New Revision: 4032a3579c529e68e899eff55a4f1714b4136e1a https://github.com/groonga/groonga-command/commit/4032a3579c529e68e899eff55a4f1714b4136e1a Message: test table_create: add table_dat_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:34:10 +0900 (69304c5) +++ lib/groonga/command/table-create.rb 2013-07-11 15:35:03 +0900 (8c7b7c3) @@ -50,6 +50,10 @@ module Groonga def table_pat_key? flags.include?("TABLE_PAT_KEY") end + + def table_dat_key? + flags.include?("TABLE_DAT_KEY") + end end end end Modified: test/command/test-table-create.rb (+17 -0) =================================================================== --- test/command/test-table-create.rb 2013-07-11 15:34:10 +0900 (ec7b395) +++ test/command/test-table-create.rb 2013-07-11 15:35:03 +0900 (d37adb6) @@ -113,6 +113,23 @@ class TableCreateCommandTest < Test::Unit::TestCase assert_equal(data[:expected], command.table_pat_key?) end end + + class TableDatKeyTest < self + data({ + "TABLE_DAT_KEY" => { + :expected => true, + :flags => "TABLE_DAT_KEY", + }, + "other flag" => { + :expected => false, + :flags => "TABLE_NO_KEY", + } + }) + def test_table_dat_key?(data) + command = parse({"flags" => data[:flags]}) + assert_equal(data[:expected], command.table_dat_key?) + end + end end end end -------------- next part -------------- HTML����������������������������...Download