Navigation Menu

Skip to content

Commit

Permalink
index-check: don't check source in content check
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 30, 2017
1 parent afb7ccd commit f071877
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
7 changes: 2 additions & 5 deletions lib/groonga/client/command-line/groonga-client-index-check.rb
@@ -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
Expand Down Expand Up @@ -179,10 +179,7 @@ def verify_tokens(table_name, old_column, new_column, tokens)
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"]
Expand Down
18 changes: 9 additions & 9 deletions test/command-line/test-index-check.rb
Expand Up @@ -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])
Expand All @@ -48,12 +48,12 @@ def test_source
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
Expand All @@ -69,10 +69,10 @@ def test_content
["_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

0 comments on commit f071877

Please sign in to comment.