Kouhei Sutou 2019-03-19 14:06:41 +0900 (Tue, 19 Mar 2019) Revision: fbc5143f70f74a9e17784eebea22b91c73829dad https://github.com/groonga/groonga-command/commit/fbc5143f70f74a9e17784eebea22b91c73829dad Message: Add support for index_column_diff Added files: lib/groonga/command/index-column-diff.rb test/command/test-index-column-diff.rb Modified files: lib/groonga/command.rb Modified: lib/groonga/command.rb (+1 -0) =================================================================== --- lib/groonga/command.rb 2018-10-23 17:19:18 +0900 (3234e7e) +++ lib/groonga/command.rb 2019-03-19 14:06:41 +0900 (0d0db0f) @@ -29,6 +29,7 @@ require "groonga/command/config-set" require "groonga/command/delete" require "groonga/command/dump" require "groonga/command/get" +require "groonga/command/index-column-diff" require "groonga/command/io-flush" require "groonga/command/load" require "groonga/command/logical-count" Added: lib/groonga/command/index-column-diff.rb (+50 -0) 100644 =================================================================== --- /dev/null +++ lib/groonga/command/index-column-diff.rb 2019-03-19 14:06:41 +0900 (d4c0ede) @@ -0,0 +1,50 @@ +# Copyright (C) 2019 Kouhei Sutou <kou****@clear*****> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +require "groonga/command/base" + +module Groonga + module Command + class IndexColumnDiff < Base + class << self + def command_name + "index_column_diff" + end + + def parameter_names + [ + :table, + :name, + ] + end + end + + Command.register(command_name, self) + + # @return [String] The table name. + # @since 1.3.9 + def table + self[:table] + end + + # @return [String] The tcolumn name. + # @since 1.3.9 + def name + self[:name] + end + end + end +end Added: test/command/test-index-column-diff.rb (+53 -0) 100644 =================================================================== --- /dev/null +++ test/command/test-index-column-diff.rb 2019-03-19 14:06:41 +0900 (1cdb313) @@ -0,0 +1,53 @@ +# Copyright (C) 2019 Kouhei Sutou <kou****@clear*****> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +class IndexColumnDiffCommandTest < Test::Unit::TestCase + private + def index_column_diff_command(pair_arguments={}, ordered_arguments=[]) + Groonga::Command::IndexColumnDiff.new(pair_arguments, + ordered_arguments) + end + + class ConstructorTest < self + def test_ordered_arguments + table = "Lexicon" + name = "content_index" + + command = index_column_diff_command({}, [table, name]) + assert_equal({ + :table => table, + :name => name, + }, + command.arguments) + end + end + + class TableTest < self + def test_reader + command = index_column_diff_command({"table" => "Lexicon"}) + assert_equal("Lexicon", + command.table) + end + end + + class NameTest < self + def test_reader + command = index_column_diff_command({"name" => "index"}) + assert_equal("index", + command.name) + end + end +end -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190319/b8bc2e66/attachment-0001.html>