rushcheck 0.5 → 0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +9 -1
- data/Rakefile.in +9 -1
- data/data/rushcheck/doc/rushcheck.thtml +55 -0
- data/data/rushcheck/examples/proc.rb +1 -1
- data/data/rushcheck/examples/rspec/stack.rb +42 -0
- data/data/rushcheck/examples/rspec/stack_spec.rb +223 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Arbitrary.src/M000035.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Assertion.html +14 -3
- data/data/rushcheck/rdoc/classes/RushCheck/Assertion.src/M000073.html +1 -2
- data/data/rushcheck/rdoc/classes/RushCheck/Assertion.src/M000074.html +6 -33
- data/data/rushcheck/rdoc/classes/RushCheck/Claim.html +199 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Claim.src/M000107.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Coarbitrary.src/M000058.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.html +3 -3
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000076.html +0 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000077.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000078.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000079.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000080.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000081.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000082.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000083.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000084.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000085.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000086.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000087.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000088.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000089.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000090.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000091.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000092.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000093.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000094.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheck.html +25 -1
- data/data/rushcheck/rdoc/created.rid +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/arbitrary_rb.html +20 -2
- data/data/rushcheck/rdoc/files/rushcheck/assertion_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/claim_rb.html +119 -0
- data/data/rushcheck/rdoc/files/rushcheck/gen_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/random_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/version_rb.html +107 -0
- data/data/rushcheck/rdoc/files/rushcheck_rb.html +3 -1
- data/data/rushcheck/rdoc/fr_class_index.html +1 -0
- data/data/rushcheck/rdoc/fr_file_index.html +2 -0
- data/data/rushcheck/rdoc/fr_method_index.html +8 -7
- data/lib/rushcheck/arbitrary.rb +15 -1
- data/lib/rushcheck/assertion.rb +21 -6
- data/lib/rushcheck/claim.rb +56 -0
- data/lib/rushcheck/gen.rb +2 -4
- data/lib/rushcheck/version.rb +1 -1
- data/lib/rushcheck.rb +1 -0
- metadata +11 -2
@@ -0,0 +1,199 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: RushCheck::Claim</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">RushCheck::Claim</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/rushcheck/claim_rb.html">
|
59
|
+
rushcheck/claim.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Assertion.html">
|
69
|
+
Assertion
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
class <a href="Claim.html">Claim</a> is one of main features of <a
|
86
|
+
href="../RushCheck.html">RushCheck</a>. You can write a testcase for random
|
87
|
+
testing as follows:
|
88
|
+
</p>
|
89
|
+
<p>
|
90
|
+
Claim.new(<a href="../Integer.html">Integer</a>, <a
|
91
|
+
href="../String.html">String</a>) do |x, y|
|
92
|
+
</p>
|
93
|
+
<pre>
|
94
|
+
RushCheck::guard { precondition }
|
95
|
+
body
|
96
|
+
</pre>
|
97
|
+
<p>
|
98
|
+
end
|
99
|
+
</p>
|
100
|
+
<p>
|
101
|
+
The notation of Claim.new is same as <a
|
102
|
+
href="Assertion.html#M000073">Assertion.new</a> is, however the semantics
|
103
|
+
are different. When checking the body of testcase, the returned value is
|
104
|
+
ignored. In other words, the body is executed but not checked the result.
|
105
|
+
However, if an exception is raised while executing the body, then checking
|
106
|
+
is failed. This means that the above testing case can be written by <a
|
107
|
+
href="Assertion.html#M000073">Assertion.new</a> as follows:
|
108
|
+
</p>
|
109
|
+
<p>
|
110
|
+
# meaning of Claim.new is similar to <a
|
111
|
+
href="Assertion.html#M000073">Assertion.new</a> <a
|
112
|
+
href="Assertion.html#M000073">Assertion.new</a>(<a
|
113
|
+
href="../Integer.html">Integer</a>, <a href="../String.html">String</a>) do
|
114
|
+
|x, y|
|
115
|
+
</p>
|
116
|
+
<pre>
|
117
|
+
RushCheck::guard { precondition }
|
118
|
+
body
|
119
|
+
true
|
120
|
+
</pre>
|
121
|
+
<p>
|
122
|
+
end
|
123
|
+
</p>
|
124
|
+
<p>
|
125
|
+
<a href="Claim.html">Claim</a> maybe useful for combining unit testing
|
126
|
+
library, because sometimes we want to execute several assertions of unit
|
127
|
+
testing library such as assert_equal(x, y). The assertions of unit testing
|
128
|
+
library does not return true or false, but return nil (just only testing).
|
129
|
+
</p>
|
130
|
+
<p>
|
131
|
+
<a href="Claim.html">Claim</a> is-an <a href="Assertion.html">Assertion</a>
|
132
|
+
so its subclass. See also <a href="Assertion.html">Assertion</a>.
|
133
|
+
</p>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div id="method-list">
|
141
|
+
<h3 class="section-bar">Methods</h3>
|
142
|
+
|
143
|
+
<div class="name-list">
|
144
|
+
<a href="#M000107">property</a>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
<!-- if includes -->
|
152
|
+
<div id="includes">
|
153
|
+
<h3 class="section-bar">Included Modules</h3>
|
154
|
+
|
155
|
+
<div id="includes-list">
|
156
|
+
<span class="include-name"><a href="Testable.html">RushCheck::Testable</a></span>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<div id="section">
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<!-- if method_list -->
|
170
|
+
<div id="methods">
|
171
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
172
|
+
|
173
|
+
<div id="method-M000107" class="method-detail">
|
174
|
+
<a name="M000107"></a>
|
175
|
+
|
176
|
+
<div class="method-heading">
|
177
|
+
<a href="Claim.src/M000107.html" target="Code" class="method-signature"
|
178
|
+
onclick="popupCode('Claim.src/M000107.html');return false;">
|
179
|
+
<span class="method-name">property</span><span class="method-args">()</span>
|
180
|
+
</a>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="method-description">
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
<div id="validator-badges">
|
195
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
</body>
|
199
|
+
</html>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>property (RushCheck::Claim)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/claim.rb, line 48</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">property</span>
|
15
|
+
<span class="ruby-identifier">_property</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-ivar">@proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
17
|
+
<span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">true</span>)
|
18
|
+
}
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/arbitrary.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/arbitrary.rb, line 40</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">g</span>)
|
15
15
|
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">"This method should be overrided."</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -420,9 +420,9 @@ belongs the given class and given length.
|
|
420
420
|
<div class="method-description">
|
421
421
|
<p>
|
422
422
|
bind is a monadic function such as Haskel’s (>>=). bind takes a
|
423
|
-
block which has
|
424
|
-
|
425
|
-
href="
|
423
|
+
block which has a variable where is the return value of the <a
|
424
|
+
href="Gen.html">Gen</a> object. The block should return a <a
|
425
|
+
href="Gen.html">Gen</a> object.
|
426
426
|
</p>
|
427
427
|
</div>
|
428
428
|
</div>
|
@@ -12,7 +12,6 @@
|
|
12
12
|
<body class="standalone-code">
|
13
13
|
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 27</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_by_gen</span>(<span class="ruby-identifier">xs</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">f</span>)
|
15
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">arity</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">xs</span>.<span class="ruby-identifier">length</span>
|
16
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
17
16
|
<span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
|
18
17
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 57</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create</span>(<span class="ruby-identifier">cs</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">f</span>)
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_by_gen</span>(<span class="ruby-identifier">cs</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">arbitrary</span>}) { <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">f</span> }
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 65</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">elements</span>(<span class="ruby-identifier">xs</span>)
|
15
15
|
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">"given argument is empty"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">xs</span>.<span class="ruby-identifier">empty?</span>
|
16
16
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 79</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">frequency</span>(<span class="ruby-identifier">xs</span>)
|
15
15
|
<span class="ruby-identifier">tot</span> = <span class="ruby-identifier">xs</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">r</span>, <span class="ruby-identifier">pair</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">pair</span>[<span class="ruby-value">0</span>]}
|
16
16
|
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">"Illegal frequency:#{xs.inspect}"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tot</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 98</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">lift_array</span>(<span class="ruby-identifier">xs</span>)
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
16
16
|
<span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 112</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">oneof</span>(<span class="ruby-identifier">gens</span>)
|
15
15
|
<span class="ruby-identifier">elements</span>(<span class="ruby-identifier">gens</span>).<span class="ruby-identifier">bind</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>}
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 122</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">promote</span>
|
15
15
|
<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">a</span>).<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>) } }
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 128</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rand</span>
|
15
15
|
<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">r</span>}
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 136</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sized</span>
|
15
15
|
<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">n</span>).<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>) }
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 143</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unit</span>(<span class="ruby-identifier">x</span>)
|
15
15
|
<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>}
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 152</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vector</span>(<span class="ruby-identifier">c</span>, <span class="ruby-identifier">len</span>)
|
15
15
|
<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
16
16
|
<span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 165</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">f</span>)
|
15
15
|
<span class="ruby-ivar">@proc</span> = <span class="ruby-identifier">f</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 172</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bind</span>
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
16
16
|
<span class="ruby-identifier">r1</span>, <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>.<span class="ruby-identifier">split</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 183</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">g</span>)
|
15
15
|
<span class="ruby-ivar">@proc</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">g</span>)
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 189</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fmap</span>
|
15
15
|
<span class="ruby-identifier">bind</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">unit</span>(<span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">x</span>)) }
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 197</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">forall</span>
|
15
15
|
<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
16
16
|
<span class="ruby-keyword kw">yield</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>).<span class="ruby-identifier">property</span>.<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">res</span><span class="ruby-operator">|</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 209</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">rnd</span>)
|
15
15
|
<span class="ruby-identifier">s</span>, <span class="ruby-identifier">r</span> = <span class="ruby-constant">Integer</span>.<span class="ruby-identifier">random</span>(<span class="ruby-identifier">rnd</span>, <span class="ruby-value">0</span>, <span class="ruby-identifier">n</span>)
|
16
16
|
<span class="ruby-identifier">value</span>(<span class="ruby-identifier">s</span>, <span class="ruby-identifier">r</span>)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 216</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">resize</span>(<span class="ruby-identifier">n</span>)
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>) }
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/gen.rb, line 223</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">variant</span>(<span class="ruby-identifier">v</span>)
|
15
15
|
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
16
16
|
<span class="ruby-identifier">g</span> = (<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">v</span>).<span class="ruby-identifier">inject</span>(<span class="ruby-identifier">r</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">gen</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
@@ -66,6 +66,10 @@
|
|
66
66
|
<a href="../files/rushcheck/bool_rb.html">
|
67
67
|
rushcheck/bool.rb
|
68
68
|
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/rushcheck/claim_rb.html">
|
71
|
+
rushcheck/claim.rb
|
72
|
+
</a>
|
69
73
|
<br />
|
70
74
|
<a href="../files/rushcheck/config_rb.html">
|
71
75
|
rushcheck/config.rb
|
@@ -102,6 +106,10 @@
|
|
102
106
|
<a href="../files/rushcheck/testresult_rb.html">
|
103
107
|
rushcheck/testresult.rb
|
104
108
|
</a>
|
109
|
+
<br />
|
110
|
+
<a href="../files/rushcheck/version_rb.html">
|
111
|
+
rushcheck/version.rb
|
112
|
+
</a>
|
105
113
|
<br />
|
106
114
|
</td>
|
107
115
|
</tr>
|
@@ -117,7 +125,9 @@
|
|
117
125
|
<div id="contextContent">
|
118
126
|
|
119
127
|
<div id="description">
|
120
|
-
<
|
128
|
+
<p>
|
129
|
+
version.rb
|
130
|
+
</p>
|
121
131
|
|
122
132
|
</div>
|
123
133
|
|
@@ -150,6 +160,7 @@ Module <a href="RushCheck/RandomBool.html" class="link">RushCheck::RandomBool</a
|
|
150
160
|
Module <a href="RushCheck/RandomGen.html" class="link">RushCheck::RandomGen</a><br />
|
151
161
|
Module <a href="RushCheck/Testable.html" class="link">RushCheck::Testable</a><br />
|
152
162
|
Class <a href="RushCheck/Assertion.html" class="link">RushCheck::Assertion</a><br />
|
163
|
+
Class <a href="RushCheck/Claim.html" class="link">RushCheck::Claim</a><br />
|
153
164
|
Class <a href="RushCheck/Config.html" class="link">RushCheck::Config</a><br />
|
154
165
|
Class <a href="RushCheck/Gen.html" class="link">RushCheck::Gen</a><br />
|
155
166
|
Class <a href="RushCheck/GuardException.html" class="link">RushCheck::GuardException</a><br />
|
@@ -165,6 +176,19 @@ Class <a href="RushCheck/TheStdGen.html" class="link">RushCheck::TheStdGen</a><b
|
|
165
176
|
|
166
177
|
</div>
|
167
178
|
|
179
|
+
<div id="constants-list">
|
180
|
+
<h3 class="section-bar">Constants</h3>
|
181
|
+
|
182
|
+
<div class="name-list">
|
183
|
+
<table summary="Constants">
|
184
|
+
<tr class="top-aligned-row context-row">
|
185
|
+
<td class="context-item-name">VERSION</td>
|
186
|
+
<td>=</td>
|
187
|
+
<td class="context-item-value">"0.6"</td>
|
188
|
+
</tr>
|
189
|
+
</table>
|
190
|
+
</div>
|
191
|
+
</div>
|
168
192
|
|
169
193
|
|
170
194
|
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Fri Oct 13 02:41:06 JST 2006
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Sun Oct 08 16:59:22 JST 2006</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -74,7 +74,25 @@
|
|
74
74
|
This file includes two modules Arbitrary and Coarbitrary. Arbitrary
|
75
75
|
provides an instance method arbitrary. Coarbitrary provides a class method
|
76
76
|
coarbitrary. However they are abstract methods and should be overrided in
|
77
|
-
each class after include
|
77
|
+
each class after extend/include them.
|
78
|
+
</p>
|
79
|
+
<p>
|
80
|
+
class YourClass
|
81
|
+
</p>
|
82
|
+
<pre>
|
83
|
+
extend RushCheck::Arbitrary
|
84
|
+
include RushCheck::Coarbitrary
|
85
|
+
|
86
|
+
def self.arbitrary
|
87
|
+
# must be overrided
|
88
|
+
end
|
89
|
+
|
90
|
+
def coarbitrary
|
91
|
+
# must be overrided also
|
92
|
+
end
|
93
|
+
</pre>
|
94
|
+
<p>
|
95
|
+
end
|
78
96
|
</p>
|
79
97
|
|
80
98
|
</div>
|