[Groonga-commit] ranguba/groonga-client at f071877 [master] index-check: don't check source in content check

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Oct 30 14:49:44 JST 2017


Kouhei Sutou	2017-10-30 14:49:44 +0900 (Mon, 30 Oct 2017)

  New Revision: f07187793fff3dc6e668f0245985c1acd42730d7
  https://github.com/ranguba/groonga-client/commit/f07187793fff3dc6e668f0245985c1acd42730d7

  Message:
    index-check: don't check source in content check

  Modified files:
    lib/groonga/client/command-line/groonga-client-index-check.rb
    test/command-line/test-index-check.rb

  Modified: lib/groonga/client/command-line/groonga-client-index-check.rb (+2 -5)
===================================================================
--- lib/groonga/client/command-line/groonga-client-index-check.rb    2017-10-27 19:24:12 +0900 (c8ec95b)
+++ lib/groonga/client/command-line/groonga-client-index-check.rb    2017-10-30 14:49:44 +0900 (5ac30ac)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016  Kouhei Sutou <kou �� clear-code.com>
+# Copyright (C) 2015-2017  Kouhei Sutou <kou �� clear-code.com>
 # Copyright (C) 2017 Kentaro Hayashi <hayashi �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
@@ -179,10 +179,7 @@ module Groonga
           end
 
           def check_content(index_column)
-            if index_column.source.empty?
-              $stderr.puts("Source is missing: <#{column.domain}.#{column.name}>")
-              return false
-            end
+            return if index_column.source.empty?
 
             table_name = index_column["domain"]
             column_name = index_column["name"]

  Modified: test/command-line/test-index-check.rb (+9 -9)
===================================================================
--- test/command-line/test-index-check.rb    2017-10-27 19:24:12 +0900 (865b4f7)
+++ test/command-line/test-index-check.rb    2017-10-30 14:49:44 +0900 (86cd4ab)
@@ -23,7 +23,7 @@ class TestCommandLineIndexCheck < Test::Unit::TestCase
   include Groonga::Client::TestHelper
   include CommandLineTestHelper
 
-  def run_client_index_check(*arguments)
+  def index_check(*arguments)
     command_line = Groonga::Client::CommandLine::GroongaClientIndexCheck.new
     capture_outputs do
       command_line.run(["--url", groonga_url, *arguments])
@@ -48,12 +48,12 @@ Source is missing: <Terms.memos_content>
     OUTPUT
 
     assert_equal([false, "", error_output],
-                 run_client_index_check("--method=source",
-                                        "Terms.memos_content"))
+                 index_check("--method=source", "Terms.memos_content"))
   end
 
-  def test_content
-    restore(<<-COMMANDS)
+  sub_test_case("content") do
+    def test_valid
+      restore(<<-COMMANDS)
 table_create Memos TABLE_HASH_KEY ShortText
 column_create Memos content COLUMN_SCALAR Text
 
@@ -69,10 +69,10 @@ load --table Memos
 ["_key", "content"],
 ["groonga", "Groonga is fast"]
 ]
-    COMMANDS
+      COMMANDS
 
-    assert_equal([true, "", ""],
-                 run_client_index_check("--method=content",
-                                        "Terms.memos_content"))
+      assert_equal([true, "", ""],
+                   index_check("--method=content", "Terms.memos_content"))
+    end
   end
 end
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20171030/73c91a6a/attachment-0001.htm 



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