Kouhei Sutou
null+****@clear*****
Tue Feb 14 20:07:11 JST 2017
Kouhei Sutou 2017-02-14 20:07:11 +0900 (Tue, 14 Feb 2017) New Revision: 588e6a1ea8efa5b83d554b761523aff95f6936f2 https://github.com/groonga/groonga/commit/588e6a1ea8efa5b83d554b761523aff95f6936f2 Message: test: create directory Added files: test/mruby/suite/query_optimizer/index/test_match.rb Removed files: test/mruby/suite/query_optimizer/test_index.rb Added: test/mruby/suite/query_optimizer/index/test_match.rb (+51 -0) 100644 =================================================================== --- /dev/null +++ test/mruby/suite/query_optimizer/index/test_match.rb 2017-02-14 20:07:11 +0900 (7a304bc) @@ -0,0 +1,51 @@ +class TestIndex < QueryOptimizerTestCase + 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") + end + end + + @logs = Groonga["Logs"] + setup_expression(@logs) + end + + def teardown + teardown_expression + end + + 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 + + def test_with_arithmetic_operator + assert_equal(<<-DUMP, dump_plan("message @ 'Groonga' && ((1 + 1) == 2)")) +[0] + op: <match> + logical_op: <or> + index: <[#<column:index Terms.Logs_message range:Logs sources:[Logs.message] flags:POSITION>]> + query: <"Groonga"> + expr: <0..2> +[1] + op: <equal> + logical_op: <and> + index: <[]> + query: <2> + expr: <3..7> + DUMP + end +end Deleted: test/mruby/suite/query_optimizer/test_index.rb (+0 -53) 100644 =================================================================== --- test/mruby/suite/query_optimizer/test_index.rb 2017-02-14 20:05:28 +0900 (21d1d45) +++ /dev/null @@ -1,53 +0,0 @@ -class TestIndex < QueryOptimizerTestCase - 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") - end - end - - @logs = Groonga["Logs"] - setup_expression(@logs) - end - - def teardown - teardown_expression - end - - 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 - - def test_with_arithmetic_operator - assert_equal(<<-DUMP, dump_plan("message @ 'Groonga' && ((1 + 1) == 2)")) -[0] - op: <match> - logical_op: <or> - index: <[#<column:index Terms.Logs_message range:Logs sources:[Logs.message] flags:POSITION>]> - query: <"Groonga"> - expr: <0..2> -[1] - op: <equal> - logical_op: <and> - index: <[]> - query: <2> - expr: <3..7> - DUMP - end - end -end -------------- next part -------------- HTML����������������������������...Download