Kouhei Sutou
null+****@clear*****
Mon Feb 24 17:39:46 JST 2014
Kouhei Sutou 2014-02-24 17:39:46 +0900 (Mon, 24 Feb 2014) New Revision: f77f4ba3602ce95939f6ae5047bc17ffbb6cb31d https://github.com/ranguba/rroonga/commit/f77f4ba3602ce95939f6ae5047bc17ffbb6cb31d Message: test: move forward index test to index column test file from column test file Modified files: test/test-column.rb test/test-index-column.rb Modified: test/test-column.rb (+0 -48) =================================================================== --- test/test-column.rb 2014-02-24 17:31:52 +0900 (25a1804) +++ test/test-column.rb 2014-02-24 17:39:46 +0900 (fc9110a) @@ -93,54 +93,6 @@ class ColumnTest < Test::Unit::TestCase assert_equal([@bookmarks_content], @bookmarks_index_content.sources) end - class UpdateIndexTest < self - def setup - setup_database - end - - def test_forward_index - Groonga::Schema.define do |schema| - schema.create_table("Tags", - :type => :patricia_trie, - :key_type => :short_text) do |table| - end - - schema.create_table("Products", - :type => :patricia_trie, - :key_type => :short_text) do |table| - table.index("Tags", - :name => "tags", - :with_weight => true) - end - end - - products = Groonga["Products"] - groonga = products.add("Groonga") - groonga.tags = [ - { - :value => "groonga", - :weight => 100, - }, - { - :value => "full text search", - :weight => 1000, - }, - ] - - assert_equal([ - { - :value => "groonga", - :weight => 100, - }, - { - :value => "full text search", - :weight => 1000, - }, - ], - groonga.tags) - end - end - def test_range assert_equal(context[Groonga::Type::SHORT_TEXT], @bookmarks_uri.range) assert_equal(context[Groonga::Type::TEXT], @bookmarks_comment.range) Modified: test/test-index-column.rb (+48 -0) =================================================================== --- test/test-index-column.rb 2014-02-24 17:31:52 +0900 (8ce6d21) +++ test/test-index-column.rb 2014-02-24 17:39:46 +0900 (6aa693a) @@ -191,6 +191,54 @@ class IndexColumnTest < Test::Unit::TestCase end end + class ForwardIndexTest < self + setup + def setup_schema + Groonga::Schema.define do |schema| + schema.create_table("Tags", + :type => :patricia_trie, + :key_type => :short_text) do |table| + end + + schema.create_table("Products", + :type => :patricia_trie, + :key_type => :short_text) do |table| + table.index("Tags", + :name => "tags", + :with_weight => true) + end + end + + @products = Groonga["Products"] + end + + def test_accessor + groonga =****@produ*****("Groonga") + groonga.tags = [ + { + :value => "groonga", + :weight => 100, + }, + { + :value => "full text search", + :weight => 1000, + }, + ] + + assert_equal([ + { + :value => "groonga", + :weight => 100, + }, + { + :value => "full text search", + :weight => 1000, + }, + ], + groonga.tags) + end + end + class NGramTest < self setup def setup_schema -------------- next part -------------- HTML����������������������������...Download