OSDN Git Service

Initial commit of senna-1.1.2-fast.
[ludiafuncs/senna-1.1.2-fast.git] / bindings / ruby / test / regression-test / fixedbug-r00346 / test_bug_r00346.rb
1 # Copyright(C) 2006 Brazil
2 #     All rights reserved.
3 #     This is free software with ABSOLUTELY NO WARRANTY.
4 #
5 # You can redistribute it and/or modify it under the terms of
6 # the GNU General Public License version 2.
7 require 'test/unit'
8 require 'senna'
9 require 'test_tools'
10
11 class FixedBugRev00346Test < Test::Unit::TestCase
12   def test_sen_set_reset_gc_bug
13     index = TestIndex::create(0, Senna::INDEX_DELIMITED)
14
15     index.update(1, 1, nil, 'MySQL has now support for full-text search')
16     index.update(2, 1, nil, 'Full-text indexes are called collections')
17     index.update(3, 1, nil, 'Only MyISAM tables support collections')
18     index.update(4, 1, nil, 'Function MATCH ... AGAINST() is used to do a search')
19     index.update(5, 1, nil, 'Full-text search in MySQL implements vector space model')
20
21     rcs = index.query_exec(Senna::Query::open('+(support collections) +foobar*'), nil, Senna::SEL_OR)
22     assert_equal(0, rcs.nhits)
23     rcs = index.query_exec(Senna::Query::open('+(+(support collections)) +foobar*'), nil, Senna::SEL_OR)
24     assert_equal(0, rcs.nhits)
25   end
26 end