rroonga 5.0.4 → 5.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -200,6 +200,17 @@ class DatabaseTest < Test::Unit::TestCase
200
200
  end
201
201
  end
202
202
 
203
+ def test_unmap
204
+ setup_database
205
+ Groonga::Schema.define do |schema|
206
+ schema.create_table("Users") do |table|
207
+ table.short_text("name")
208
+ end
209
+ end
210
+
211
+ @database.unmap
212
+ end
213
+
203
214
  def test_tables
204
215
  setup_database
205
216
  Groonga::Schema.define do |schema|
@@ -37,6 +37,12 @@ class LoggerTest < Test::Unit::TestCase
37
37
  assert_true(@log_path.exist?)
38
38
  end
39
39
 
40
+ def test_max_level
41
+ assert_equal(:notice, Groonga::Logger.max_level)
42
+ Groonga::Logger.max_level = :debug
43
+ assert_equal(:debug, Groonga::Logger.max_level)
44
+ end
45
+
40
46
  sub_test_case ".log" do
41
47
  test "no options" do
42
48
  messages = []
@@ -194,19 +194,19 @@ class OperatorTest < Test::Unit::TestCase
194
194
  sub_test_case "regexp" do
195
195
  sub_test_case "#exec" do
196
196
  test "match" do
197
- assert_true(Groonga::Operator::REGEXP.exec("Hello Rroonga",
198
- /Rro+nga/))
197
+ assert_true(Groonga::Operator::REGEXP.exec("hello rroonga",
198
+ /rro+nga/))
199
199
  end
200
200
 
201
201
  test "not match" do
202
- assert_false(Groonga::Operator::REGEXP.exec("Hello Rroonga",
203
- /Gro+nga/))
202
+ assert_false(Groonga::Operator::REGEXP.exec("hello rroonga",
203
+ /gro+nga/))
204
204
  end
205
205
 
206
206
  test ":context" do
207
207
  context = Groonga::Context.new
208
- assert_true(Groonga::Operator::REGEXP.exec("Hello Rroonga",
209
- /Rro+nga/,
208
+ assert_true(Groonga::Operator::REGEXP.exec("hello rroonga",
209
+ /rro+nga/,
210
210
  :context => context))
211
211
  end
212
212
  end
@@ -1,4 +1,5 @@
1
1
  # Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
2
+ # Copyright (C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
2
3
  #
3
4
  # This library is free software; you can redistribute it and/or
4
5
  # modify it under the terms of the GNU Lesser General Public
@@ -70,4 +71,18 @@ class ProcedureTest < Test::Unit::TestCase
70
71
  assert_equal(Groonga::ProcedureType::SCORER, scorer.type)
71
72
  end
72
73
  end
74
+
75
+ class SelectorOnlyProcedureTest < self
76
+ def test_true
77
+ assert do
78
+ Groonga["sub_filter"].selector_only_procedure?
79
+ end
80
+ end
81
+
82
+ def test_false
83
+ assert do
84
+ not Groonga["between"].selector_only_procedure?
85
+ end
86
+ end
87
+ end
73
88
  end
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -33,6 +33,175 @@ class TableDumperTest < Test::Unit::TestCase
33
33
  context["Posts"]
34
34
  end
35
35
 
36
+ class TableTest < self
37
+ class ArrayTest < self
38
+ class OrderByTest < self
39
+ def setup
40
+ Groonga::Schema.define do |schema|
41
+ schema.create_table("Users") do |table|
42
+ table.text("name")
43
+ end
44
+ end
45
+
46
+ @users = Groonga["Users"]
47
+ @users.add(:name => "Chris")
48
+ @users.add(:name => "Bob")
49
+ @users.add(:name => "Alice")
50
+ end
51
+
52
+ def test_id
53
+ assert_equal(<<-DUMP, dump("Users", :order_by => :id))
54
+ load --table Users
55
+ [
56
+ ["_id","name"],
57
+ [1,"Chris"],
58
+ [2,"Bob"],
59
+ [3,"Alice"]
60
+ ]
61
+ DUMP
62
+ end
63
+
64
+ def test_key
65
+ assert_equal(<<-DUMP, dump("Users", :order_by => :key))
66
+ load --table Users
67
+ [
68
+ ["_id","name"],
69
+ [1,"Chris"],
70
+ [2,"Bob"],
71
+ [3,"Alice"]
72
+ ]
73
+ DUMP
74
+ end
75
+ end
76
+ end
77
+
78
+ class HashTest < self
79
+ class OrderByTest < self
80
+ def setup
81
+ Groonga::Schema.define do |schema|
82
+ schema.create_table("Users",
83
+ :type => :hash,
84
+ :key_type => "ShortText") do |table|
85
+ end
86
+ end
87
+
88
+ @users = Groonga["Users"]
89
+ @users.add("Chris")
90
+ @users.add("Bob")
91
+ @users.add("Alice")
92
+ end
93
+
94
+ def test_id
95
+ assert_equal(<<-DUMP, dump("Users", :order_by => :id))
96
+ load --table Users
97
+ [
98
+ ["_key"],
99
+ ["Chris"],
100
+ ["Bob"],
101
+ ["Alice"]
102
+ ]
103
+ DUMP
104
+ end
105
+
106
+ def test_key
107
+ assert_equal(<<-DUMP, dump("Users", :order_by => :key))
108
+ load --table Users
109
+ [
110
+ ["_key"],
111
+ ["Chris"],
112
+ ["Bob"],
113
+ ["Alice"]
114
+ ]
115
+ DUMP
116
+ end
117
+ end
118
+ end
119
+
120
+ class PatriciaTrieTest < self
121
+ class OrderByTest < self
122
+ def setup
123
+ Groonga::Schema.define do |schema|
124
+ schema.create_table("Users",
125
+ :type => :patricia_trie,
126
+ :key_type => "ShortText") do |table|
127
+ end
128
+ end
129
+
130
+ @users = Groonga["Users"]
131
+ @users.add("Chris")
132
+ @users.add("Bob")
133
+ @users.add("Alice")
134
+ end
135
+
136
+ def test_id
137
+ assert_equal(<<-DUMP, dump("Users", :order_by => :id))
138
+ load --table Users
139
+ [
140
+ ["_key"],
141
+ ["Chris"],
142
+ ["Bob"],
143
+ ["Alice"]
144
+ ]
145
+ DUMP
146
+ end
147
+
148
+ def test_key
149
+ assert_equal(<<-DUMP, dump("Users", :order_by => :key))
150
+ load --table Users
151
+ [
152
+ ["_key"],
153
+ ["Alice"],
154
+ ["Bob"],
155
+ ["Chris"]
156
+ ]
157
+ DUMP
158
+ end
159
+ end
160
+ end
161
+
162
+ class DoubleArrayTrieTest < self
163
+ class OrderByTest < self
164
+ def setup
165
+ Groonga::Schema.define do |schema|
166
+ schema.create_table("Users",
167
+ :type => :double_array_trie,
168
+ :key_type => "ShortText") do |table|
169
+ end
170
+ end
171
+
172
+ @users = Groonga["Users"]
173
+ @users.add("Chris")
174
+ @users.add("Bob")
175
+ @users.add("Alice")
176
+ end
177
+
178
+ def test_id
179
+ assert_equal(<<-DUMP, dump("Users", :order_by => :id))
180
+ load --table Users
181
+ [
182
+ ["_key"],
183
+ ["Chris"],
184
+ ["Bob"],
185
+ ["Alice"]
186
+ ]
187
+ DUMP
188
+ end
189
+
190
+ def test_key
191
+ assert_equal(<<-DUMP, dump("Users", :order_by => :key))
192
+ load --table Users
193
+ [
194
+ ["_key"],
195
+ ["Alice"],
196
+ ["Bob"],
197
+ ["Chris"]
198
+ ]
199
+ DUMP
200
+ end
201
+ end
202
+ end
203
+ end
204
+
36
205
  class TextTest < self
37
206
  class ScalarTest < self
38
207
  def setup
@@ -0,0 +1,42 @@
1
+ # Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License version 2.1 as published by the Free Software Foundation.
6
+ #
7
+ # This library is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
+ # Lesser General Public License for more details.
11
+ #
12
+ # You should have received a copy of the GNU Lesser General Public
13
+ # License along with this library; if not, write to the Free Software
14
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
+
16
+ class ThreadTest < Test::Unit::TestCase
17
+ include GroongaTestUtils
18
+
19
+ sub_test_case "limit" do
20
+ teardown do
21
+ Groonga::Thread.limit_getter = nil
22
+ Groonga::Thread.limit_setter = nil
23
+ end
24
+
25
+ test "default" do
26
+ assert_equal(0, Groonga::Thread.limit)
27
+ end
28
+
29
+ test "custom" do
30
+ limit = 0
31
+ Groonga::Thread.limit_getter = lambda do
32
+ limit
33
+ end
34
+ Groonga::Thread.limit_setter = lambda do |new_limit|
35
+ limit = new_limit
36
+ end
37
+
38
+ Groonga::Thread.limit = 10
39
+ assert_equal(10, Groonga::Thread.limit)
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,28 @@
1
+ # Copyright (C) 2015 Kouhei Sutou <kou@clear-code.com>
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License version 2.1 as published by the Free Software Foundation.
6
+ #
7
+ # This library is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10
+ # Lesser General Public License for more details.
11
+ #
12
+ # You should have received a copy of the GNU Lesser General Public
13
+ # License along with this library; if not, write to the Free Software
14
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
+
16
+ class WindowsEventLoggerTest < Test::Unit::TestCase
17
+ include GroongaTestUtils
18
+
19
+ test "#register" do
20
+ if windows?
21
+ Groonga::WindowsEventLogger.register("Rroonga")
22
+ else
23
+ assert_raise(Groonga::FunctionNotImplemented) do
24
+ Groonga::WindowsEventLogger.register("Rroonga")
25
+ end
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rroonga
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.4
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-07-13 00:00:00.000000000 Z
15
+ date: 2015-09-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: pkg-config
@@ -195,8 +195,8 @@ email:
195
195
  - dara@shidara.net
196
196
  executables:
197
197
  - groonga-index-dump
198
- - groonga-database-inspect
199
198
  - grndump
199
+ - groonga-database-inspect
200
200
  - grntest-log-analyze
201
201
  extensions:
202
202
  - ext/groonga/extconf.rb
@@ -221,6 +221,9 @@ files:
221
221
  - doc/images/sample-schema.png
222
222
  - example/bookmark.rb
223
223
  - example/index-html.rb
224
+ - example/measure-data-column-disk-usage.rb
225
+ - example/measure-index-column-disk-usage.rb
226
+ - example/measure-table-disk-usage.rb
224
227
  - ext/groonga/extconf.rb
225
228
  - ext/groonga/groonga.def
226
229
  - ext/groonga/rb-grn-accessor.c
@@ -269,10 +272,12 @@ files:
269
272
  - ext/groonga/rb-grn-table-cursor.c
270
273
  - ext/groonga/rb-grn-table-key-support.c
271
274
  - ext/groonga/rb-grn-table.c
275
+ - ext/groonga/rb-grn-thread.c
272
276
  - ext/groonga/rb-grn-type.c
273
277
  - ext/groonga/rb-grn-utils.c
274
278
  - ext/groonga/rb-grn-variable-size-column.c
275
279
  - ext/groonga/rb-grn-variable.c
280
+ - ext/groonga/rb-grn-windows-event-logger.c
276
281
  - ext/groonga/rb-grn.h
277
282
  - ext/groonga/rb-groonga.c
278
283
  - extconf.rb
@@ -354,12 +359,14 @@ files:
354
359
  - test/test-table-select.rb
355
360
  - test/test-table-traverse.rb
356
361
  - test/test-table.rb
362
+ - test/test-thread.rb
357
363
  - test/test-token-regexp.rb
358
364
  - test/test-type.rb
359
365
  - test/test-variable-size-column.rb
360
366
  - test/test-variable.rb
361
367
  - test/test-vector-column.rb
362
368
  - test/test-version.rb
369
+ - test/test-windows-event-logger.rb
363
370
  homepage: http://ranguba.org/#about-rroonga
364
371
  licenses:
365
372
  - LGPL-2.1
@@ -387,62 +394,64 @@ specification_version: 4
387
394
  summary: Ruby bindings for Groonga that provide full text search and column store
388
395
  features.
389
396
  test_files:
397
+ - test/test-schema.rb
398
+ - test/test-snippet.rb
399
+ - test/test-variable.rb
400
+ - test/test-geo-point.rb
390
401
  - test/test-plugin.rb
391
- - test/test-query-logger.rb
402
+ - test/test-table-group.rb
403
+ - test/test-accessor.rb
404
+ - test/test-double-array-trie.rb
405
+ - test/test-pagination.rb
406
+ - test/test-memory-pool.rb
407
+ - test/test-column.rb
408
+ - test/test-table-traverse.rb
409
+ - test/test-expression.rb
392
410
  - test/test-table-select.rb
411
+ - test/test-encoding.rb
412
+ - test/test-logger.rb
413
+ - test/test-schema-create-table.rb
414
+ - test/test-hash.rb
415
+ - test/test-type.rb
393
416
  - test/test-table-offset-and-limit.rb
394
- - test/test-token-regexp.rb
395
- - test/test-sub-records.rb
396
- - test/test-index-cursor.rb
397
- - test/test-convert.rb
398
417
  - test/test-version.rb
399
- - test/test-table.rb
400
418
  - test/test-lock-timeout.rb
401
- - test/test-schema-create-table.rb
402
419
  - test/test-index-column.rb
420
+ - test/test-table-key-support.rb
421
+ - test/test-vector-column.rb
422
+ - test/test-normalizer.rb
423
+ - test/test-table-select-weight.rb
424
+ - test/test-schema-type.rb
425
+ - test/test-sub-records.rb
426
+ - test/test-procedure.rb
427
+ - test/test-context.rb
428
+ - test/test-gqtp.rb
429
+ - test/test-remote.rb
430
+ - test/test-database-dumper.rb
431
+ - test/test-database-inspector.rb
432
+ - test/test-patricia-trie.rb
433
+ - test/run-test.rb
403
434
  - test/test-fix-size-column.rb
404
- - test/test-table-dumper.rb
435
+ - test/test-statistic-measurer.rb
405
436
  - test/test-array.rb
437
+ - test/test-table.rb
438
+ - test/groonga-test-utils.rb
406
439
  - test/test-record.rb
440
+ - test/test-exception.rb
441
+ - test/test-table-select-normalize.rb
442
+ - test/test-thread.rb
407
443
  - test/test-schema-dumper.rb
408
- - test/test-variable-size-column.rb
409
- - test/test-type.rb
410
- - test/test-pagination.rb
411
- - test/test-database-dumper.rb
412
- - test/test-table-group.rb
413
- - test/test-accessor.rb
444
+ - test/test-token-regexp.rb
445
+ - test/test-table-dumper.rb
414
446
  - test/test-database.rb
415
- - test/test-database-inspector.rb
416
- - test/test-operator.rb
417
- - test/test-procedure.rb
447
+ - test/test-query-logger.rb
448
+ - test/test-variable-size-column.rb
449
+ - test/test-table-select-mecab.rb
450
+ - test/test-windows-event-logger.rb
418
451
  - test/test-expression-builder.rb
419
- - test/test-command-select.rb
420
- - test/test-double-array-trie.rb
421
- - test/test-vector-column.rb
422
- - test/test-encoding.rb
423
- - test/test-table-key-support.rb
424
- - test/test-gqtp.rb
425
- - test/run-test.rb
426
- - test/test-patricia-trie.rb
427
- - test/test-remote.rb
428
- - test/test-table-select-weight.rb
429
- - test/test-statistic-measurer.rb
430
- - test/test-logger.rb
431
- - test/test-hash.rb
432
- - test/test-schema-type.rb
433
- - test/test-normalizer.rb
452
+ - test/test-operator.rb
434
453
  - test/test-flushable.rb
435
- - test/test-snippet.rb
436
- - test/test-variable.rb
437
- - test/test-memory-pool.rb
438
- - test/test-exception.rb
439
- - test/test-table-select-mecab.rb
440
- - test/test-table-select-normalize.rb
441
- - test/test-schema.rb
442
- - test/test-geo-point.rb
443
- - test/test-table-traverse.rb
444
- - test/groonga-test-utils.rb
445
- - test/test-column.rb
446
- - test/test-context.rb
447
- - test/test-expression.rb
454
+ - test/test-convert.rb
455
+ - test/test-index-cursor.rb
456
+ - test/test-command-select.rb
448
457
  has_rdoc: