Kouhei Sutou
null+****@clear*****
Tue Feb 14 20:04:49 JST 2017
Kouhei Sutou 2017-02-14 20:04:49 +0900 (Tue, 14 Feb 2017) New Revision: 3469ad70a6e745ec090be7d9defde6cfea6ca8a3 https://github.com/groonga/groonga/commit/3469ad70a6e745ec090be7d9defde6cfea6ca8a3 Message: test: group by match Modified files: test/mruby/suite/query_optimizer/test_index.rb Modified: test/mruby/suite/query_optimizer/test_index.rb (+26 -24) =================================================================== --- test/mruby/suite/query_optimizer/test_index.rb 2017-02-14 19:55:59 +0900 (5f8f12c) +++ test/mruby/suite/query_optimizer/test_index.rb 2017-02-14 20:04:49 +0900 (21d1d45) @@ -1,39 +1,40 @@ class TestIndex < QueryOptimizerTestCase - def setup - Groonga::Schema.define do |schema| - schema.create_table("Logs") do |table| - table.text("message") - end + class TestMatch < self + def setup + Groonga::Schema.define do |schema| + schema.create_table("Logs") do |table| + table.text("message") + end - schema.create_table("Terms", - :type => :patricia_trie, - :default_tokenizer => "TokenBigram", - :normalizer => "NormalizerAuto") do |table| - table.index("Logs", "message") + schema.create_table("Terms", + :type => :patricia_trie, + :default_tokenizer => "TokenBigram", + :normalizer => "NormalizerAuto") do |table| + table.index("Logs", "message") + end end - end - @logs = Groonga["Logs"] - setup_expression(@logs) - end + @logs = Groonga["Logs"] + setup_expression(@logs) + end - def teardown - teardown_expression - end + def teardown + teardown_expression + end - def test_match - assert_equal(<<-DUMP, dump_plan("message @ 'Groonga'")) + def test_only + assert_equal(<<-DUMP, dump_plan("message @ 'Groonga'")) [0] op: <match> logical_op: <or> index: <[#<column:index Terms.Logs_message range:Logs sources:[Logs.message] flags:POSITION>]> query: <"Groonga"> expr: <0..2> - DUMP - end + DUMP + end - def test_with_arithmetic_operator - assert_equal(<<-DUMP, dump_plan("message @ 'Groonga' && ((1 + 1) == 2)")) + def test_with_arithmetic_operator + assert_equal(<<-DUMP, dump_plan("message @ 'Groonga' && ((1 + 1) == 2)")) [0] op: <match> logical_op: <or> @@ -46,6 +47,7 @@ class TestIndex < QueryOptimizerTestCase index: <[]> query: <2> expr: <3..7> - DUMP + DUMP + end end end -------------- next part -------------- HTML����������������������������...Télécharger