rroonga 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.ja.rdoc +11 -0
- data/NEWS.rdoc +11 -0
- data/README.ja.rdoc +1 -0
- data/README.rdoc +1 -0
- data/ext/groonga/mkmf.log +99 -0
- data/ext/groonga/rb-grn-array.c +1 -1
- data/ext/groonga/rb-grn-hash.c +1 -1
- data/ext/groonga/rb-grn-patricia-trie.c +1 -1
- data/ext/groonga/rb-grn.h +1 -1
- data/test/test-patricia-trie.rb +10 -0
- metadata +25 -102
- data/test-unit-notify/Rakefile +0 -47
- data/test-unit-notify/lib/test/unit/notify.rb +0 -104
- data/test-unit/COPYING +0 -56
- data/test-unit/GPL +0 -340
- data/test-unit/PSFL +0 -271
- data/test-unit/Rakefile +0 -53
- data/test-unit/TODO +0 -5
- data/test-unit/bin/testrb +0 -5
- data/test-unit/html/bar.svg +0 -153
- data/test-unit/html/developer.svg +0 -469
- data/test-unit/html/favicon.ico +0 -0
- data/test-unit/html/favicon.svg +0 -82
- data/test-unit/html/heading-mark.svg +0 -393
- data/test-unit/html/index.html +0 -247
- data/test-unit/html/index.html.ja +0 -270
- data/test-unit/html/install.svg +0 -636
- data/test-unit/html/logo.svg +0 -483
- data/test-unit/html/test-unit.css +0 -339
- data/test-unit/html/tutorial.svg +0 -559
- data/test-unit/lib/test/unit.rb +0 -328
- data/test-unit/lib/test/unit/assertionfailederror.rb +0 -25
- data/test-unit/lib/test/unit/assertions.rb +0 -1334
- data/test-unit/lib/test/unit/attribute.rb +0 -125
- data/test-unit/lib/test/unit/autorunner.rb +0 -363
- data/test-unit/lib/test/unit/collector.rb +0 -36
- data/test-unit/lib/test/unit/collector/descendant.rb +0 -23
- data/test-unit/lib/test/unit/collector/dir.rb +0 -108
- data/test-unit/lib/test/unit/collector/load.rb +0 -144
- data/test-unit/lib/test/unit/collector/objectspace.rb +0 -34
- data/test-unit/lib/test/unit/color-scheme.rb +0 -106
- data/test-unit/lib/test/unit/color.rb +0 -96
- data/test-unit/lib/test/unit/diff.rb +0 -740
- data/test-unit/lib/test/unit/error.rb +0 -130
- data/test-unit/lib/test/unit/exceptionhandler.rb +0 -39
- data/test-unit/lib/test/unit/failure.rb +0 -136
- data/test-unit/lib/test/unit/fixture.rb +0 -176
- data/test-unit/lib/test/unit/notification.rb +0 -129
- data/test-unit/lib/test/unit/omission.rb +0 -191
- data/test-unit/lib/test/unit/pending.rb +0 -150
- data/test-unit/lib/test/unit/priority.rb +0 -180
- data/test-unit/lib/test/unit/runner/console.rb +0 -52
- data/test-unit/lib/test/unit/runner/emacs.rb +0 -8
- data/test-unit/lib/test/unit/runner/tap.rb +0 -8
- data/test-unit/lib/test/unit/testcase.rb +0 -483
- data/test-unit/lib/test/unit/testresult.rb +0 -121
- data/test-unit/lib/test/unit/testsuite.rb +0 -110
- data/test-unit/lib/test/unit/ui/console/outputlevel.rb +0 -14
- data/test-unit/lib/test/unit/ui/console/testrunner.rb +0 -430
- data/test-unit/lib/test/unit/ui/emacs/testrunner.rb +0 -63
- data/test-unit/lib/test/unit/ui/tap/testrunner.rb +0 -82
- data/test-unit/lib/test/unit/ui/testrunner.rb +0 -53
- data/test-unit/lib/test/unit/ui/testrunnermediator.rb +0 -77
- data/test-unit/lib/test/unit/ui/testrunnerutilities.rb +0 -41
- data/test-unit/lib/test/unit/util/backtracefilter.rb +0 -42
- data/test-unit/lib/test/unit/util/method-owner-finder.rb +0 -28
- data/test-unit/lib/test/unit/util/observable.rb +0 -90
- data/test-unit/lib/test/unit/util/output.rb +0 -31
- data/test-unit/lib/test/unit/util/procwrapper.rb +0 -48
- data/test-unit/lib/test/unit/version.rb +0 -7
- data/test-unit/sample/adder.rb +0 -13
- data/test-unit/sample/subtracter.rb +0 -12
- data/test-unit/sample/test_adder.rb +0 -20
- data/test-unit/sample/test_subtracter.rb +0 -20
- data/test-unit/sample/test_user.rb +0 -23
- data/test-unit/test/collector/test-descendant.rb +0 -133
- data/test-unit/test/collector/test-load.rb +0 -442
- data/test-unit/test/collector/test_dir.rb +0 -406
- data/test-unit/test/collector/test_objectspace.rb +0 -100
- data/test-unit/test/run-test.rb +0 -15
- data/test-unit/test/test-attribute.rb +0 -86
- data/test-unit/test/test-color-scheme.rb +0 -69
- data/test-unit/test/test-color.rb +0 -47
- data/test-unit/test/test-diff.rb +0 -518
- data/test-unit/test/test-emacs-runner.rb +0 -60
- data/test-unit/test/test-fixture.rb +0 -287
- data/test-unit/test/test-notification.rb +0 -33
- data/test-unit/test/test-omission.rb +0 -81
- data/test-unit/test/test-pending.rb +0 -70
- data/test-unit/test/test-priority.rb +0 -119
- data/test-unit/test/test-testcase.rb +0 -544
- data/test-unit/test/test_assertions.rb +0 -1197
- data/test-unit/test/test_error.rb +0 -26
- data/test-unit/test/test_failure.rb +0 -33
- data/test-unit/test/test_testresult.rb +0 -113
- data/test-unit/test/test_testsuite.rb +0 -129
- data/test-unit/test/testunit-test-util.rb +0 -14
- data/test-unit/test/ui/test_tap.rb +0 -33
- data/test-unit/test/ui/test_testrunmediator.rb +0 -20
- data/test-unit/test/util/test-method-owner-finder.rb +0 -38
- data/test-unit/test/util/test-output.rb +0 -11
- data/test-unit/test/util/test_backtracefilter.rb +0 -41
- data/test-unit/test/util/test_observable.rb +0 -102
- data/test-unit/test/util/test_procwrapper.rb +0 -36
@@ -1,102 +0,0 @@
|
|
1
|
-
# Author:: Nathaniel Talbott.
|
2
|
-
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
3
|
-
# License:: Ruby license.
|
4
|
-
|
5
|
-
require 'test/unit/util/observable'
|
6
|
-
|
7
|
-
module Test
|
8
|
-
module Unit
|
9
|
-
module Util
|
10
|
-
class TC_Observable < TestCase
|
11
|
-
|
12
|
-
class TF_Observable
|
13
|
-
include Observable
|
14
|
-
end
|
15
|
-
|
16
|
-
def setup
|
17
|
-
@observable = TF_Observable.new
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_simple_observation
|
21
|
-
assert_raises(ArgumentError, "add_listener should throw an exception if no callback is supplied") do
|
22
|
-
@observable.add_listener(:property, "a")
|
23
|
-
end
|
24
|
-
|
25
|
-
heard = false
|
26
|
-
callback = proc { heard = true }
|
27
|
-
assert_equal("a", @observable.add_listener(:property, "a", &callback), "add_listener should return the listener that was added")
|
28
|
-
|
29
|
-
count = 0
|
30
|
-
@observable.instance_eval do
|
31
|
-
count = notify_listeners(:property)
|
32
|
-
end
|
33
|
-
assert_equal(1, count, "notify_listeners should have returned the number of listeners that were notified")
|
34
|
-
assert(heard, "Should have heard the property changed")
|
35
|
-
|
36
|
-
heard = false
|
37
|
-
assert_equal(callback, @observable.remove_listener(:property, "a"), "remove_listener should return the callback")
|
38
|
-
|
39
|
-
count = 1
|
40
|
-
@observable.instance_eval do
|
41
|
-
count = notify_listeners(:property)
|
42
|
-
end
|
43
|
-
assert_equal(0, count, "notify_listeners should have returned the number of listeners that were notified")
|
44
|
-
assert(!heard, "Should not have heard the property change")
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_value_observation
|
48
|
-
value = nil
|
49
|
-
@observable.add_listener(:property, "a") do |passed_value|
|
50
|
-
value = passed_value
|
51
|
-
end
|
52
|
-
count = 0
|
53
|
-
@observable.instance_eval do
|
54
|
-
count = notify_listeners(:property, "stuff")
|
55
|
-
end
|
56
|
-
assert_equal(1, count, "Should have update the correct number of listeners")
|
57
|
-
assert_equal("stuff", value, "Should have received the value as an argument to the listener")
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_multiple_value_observation
|
61
|
-
values = []
|
62
|
-
@observable.add_listener(:property, "a") do |first_value, second_value|
|
63
|
-
values = [first_value, second_value]
|
64
|
-
end
|
65
|
-
count = 0
|
66
|
-
@observable.instance_eval do
|
67
|
-
count = notify_listeners(:property, "stuff", "more stuff")
|
68
|
-
end
|
69
|
-
assert_equal(1, count, "Should have update the correct number of listeners")
|
70
|
-
assert_equal(["stuff", "more stuff"], values, "Should have received the value as an argument to the listener")
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_add_remove_with_default_listener
|
74
|
-
assert_raises(ArgumentError, "add_listener should throw an exception if no callback is supplied") do
|
75
|
-
@observable.add_listener(:property)
|
76
|
-
end
|
77
|
-
|
78
|
-
heard = false
|
79
|
-
callback = proc { heard = true }
|
80
|
-
assert_equal(callback, @observable.add_listener(:property, &callback), "add_listener should return the listener that was added")
|
81
|
-
|
82
|
-
count = 0
|
83
|
-
@observable.instance_eval do
|
84
|
-
count = notify_listeners(:property)
|
85
|
-
end
|
86
|
-
assert_equal(1, count, "notify_listeners should have returned the number of listeners that were notified")
|
87
|
-
assert(heard, "Should have heard the property changed")
|
88
|
-
|
89
|
-
heard = false
|
90
|
-
assert_equal(callback, @observable.remove_listener(:property, callback), "remove_listener should return the callback")
|
91
|
-
|
92
|
-
count = 1
|
93
|
-
@observable.instance_eval do
|
94
|
-
count = notify_listeners(:property)
|
95
|
-
end
|
96
|
-
assert_equal(0, count, "notify_listeners should have returned the number of listeners that were notified")
|
97
|
-
assert(!heard, "Should not have heard the property change")
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# Author:: Nathaniel Talbott.
|
2
|
-
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
|
3
|
-
# License:: Ruby license.
|
4
|
-
|
5
|
-
require 'test/unit'
|
6
|
-
require 'test/unit/util/procwrapper'
|
7
|
-
|
8
|
-
module Test
|
9
|
-
module Unit
|
10
|
-
module Util
|
11
|
-
class TC_ProcWrapper < TestCase
|
12
|
-
def munge_proc(&a_proc)
|
13
|
-
return a_proc
|
14
|
-
end
|
15
|
-
def setup
|
16
|
-
@original = proc {}
|
17
|
-
@munged = munge_proc(&@original)
|
18
|
-
@wrapped_original = ProcWrapper.new(@original)
|
19
|
-
@wrapped_munged = ProcWrapper.new(@munged)
|
20
|
-
end
|
21
|
-
def test_wrapping
|
22
|
-
assert_same(@original, @wrapped_original.to_proc, "The wrapper should return what was wrapped")
|
23
|
-
end
|
24
|
-
def test_hashing
|
25
|
-
|
26
|
-
assert_equal(@wrapped_original.hash, @wrapped_munged.hash, "The original and munged should have the same hash when wrapped")
|
27
|
-
assert_equal(@wrapped_original, @wrapped_munged, "The wrappers should be equivalent")
|
28
|
-
|
29
|
-
a_hash = {@wrapped_original => @original}
|
30
|
-
assert(a_hash[@wrapped_original], "Should be able to access the wrapper in the hash")
|
31
|
-
assert_equal(a_hash[@wrapped_original], @original, "Should be able to access the wrapper in the hash")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|