rushcheck 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -18
- data/Rakefile +18 -2
- data/Rakefile.in +17 -1
- data/data/rushcheck/doc/rushcheck.thtml +4 -3
- data/data/rushcheck/examples/roguetile.rb +2 -2
- data/data/rushcheck/examples/rspec/stack_spec.rb +22 -22
- data/data/rushcheck/rdoc/classes/FalseClass.html +15 -15
- data/data/rushcheck/rdoc/classes/FalseClass.src/M000008.html +4 -4
- data/data/rushcheck/rdoc/classes/FalseClass.src/M000009.html +18 -0
- data/data/rushcheck/rdoc/classes/FalseClass.src/M000010.html +18 -0
- data/data/rushcheck/rdoc/classes/Float.html +20 -20
- data/data/rushcheck/rdoc/classes/Float.src/M000021.html +21 -0
- data/data/rushcheck/rdoc/classes/Float.src/M000022.html +18 -0
- data/data/rushcheck/rdoc/classes/Float.src/M000023.html +22 -0
- data/data/rushcheck/rdoc/classes/Float.src/M000024.html +20 -0
- data/data/rushcheck/rdoc/classes/NegativeInteger.html +160 -0
- data/data/rushcheck/rdoc/classes/NegativeInteger.src/M000005.html +26 -0
- data/data/rushcheck/rdoc/classes/NegativeInteger.src/M000006.html +21 -0
- data/data/rushcheck/rdoc/classes/NilClass.html +15 -15
- data/data/rushcheck/rdoc/classes/NilClass.src/M000029.html +18 -0
- data/data/rushcheck/rdoc/classes/NilClass.src/M000030.html +18 -0
- data/data/rushcheck/rdoc/classes/NilClass.src/M000031.html +18 -0
- data/data/rushcheck/rdoc/classes/NonEmptyRandomArray.html +139 -0
- data/data/rushcheck/rdoc/classes/NonEmptyRandomArray.src/M000011.html +20 -0
- data/data/rushcheck/rdoc/classes/PositiveInteger.html +160 -0
- data/data/rushcheck/rdoc/classes/PositiveInteger.src/M000032.html +26 -0
- data/data/rushcheck/rdoc/classes/PositiveInteger.src/M000033.html +21 -0
- data/data/rushcheck/rdoc/classes/RandomArray.html +75 -15
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000012.html +19 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000013.html +25 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000014.html +27 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000015.html +23 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000016.html +23 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000017.html +22 -0
- data/data/rushcheck/rdoc/classes/RandomHash.html +16 -16
- data/data/rushcheck/rdoc/classes/RandomHash.src/M000018.html +19 -0
- data/data/rushcheck/rdoc/classes/RandomHash.src/M000019.html +26 -0
- data/data/rushcheck/rdoc/classes/RandomHash.src/M000020.html +22 -0
- data/data/rushcheck/rdoc/classes/RandomProc.html +20 -20
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000025.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000026.html +30 -0
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000027.html +26 -0
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000028.html +20 -0
- data/data/rushcheck/rdoc/classes/RushCheck.html +10 -10
- data/data/rushcheck/rdoc/classes/RushCheck.src/M000041.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck.src/M000042.html +27 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Arbitrary.html +5 -5
- data/data/rushcheck/rdoc/classes/RushCheck/Arbitrary.src/M000043.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Assertion.html +12 -12
- data/data/rushcheck/rdoc/classes/RushCheck/Assertion.src/M000081.html +19 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Assertion.src/M000082.html +23 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Claim.html +9 -9
- data/data/rushcheck/rdoc/classes/RushCheck/Claim.src/M000116.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Coarbitrary.html +5 -5
- data/data/rushcheck/rdoc/classes/RushCheck/Coarbitrary.src/M000066.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.html +35 -35
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000074.html +23 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000075.html +22 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000076.html +22 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000077.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000078.html +38 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000079.html +55 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Config.src/M000080.html +50 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.html +107 -107
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000083.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000084.html +26 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000085.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000086.html +6 -10
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000087.html +14 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000088.html +9 -6
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000089.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000090.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000091.html +4 -9
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000092.html +4 -5
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000093.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000094.html +8 -8
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000095.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000096.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000097.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000098.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000099.html +23 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000100.html +19 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000101.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Gen.src/M000102.html +22 -0
- data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.html +20 -20
- data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.src/M000049.html +22 -0
- data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.src/M000050.html +32 -0
- data/data/rushcheck/rdoc/classes/RushCheck/HsRandom.src/M000051.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Property.html +10 -10
- data/data/rushcheck/rdoc/classes/RushCheck/Property.src/M000114.html +26 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Property.src/M000115.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/RandomBool.html +10 -10
- data/data/rushcheck/rdoc/classes/RushCheck/RandomBool.src/M000047.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/RandomBool.src/M000048.html +19 -0
- data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.html +20 -20
- data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.src/M000044.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.src/M000045.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/RandomGen.src/M000046.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Result.html +19 -19
- data/data/rushcheck/rdoc/classes/RushCheck/Result.src/M000103.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Result.src/M000104.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Result.src/M000105.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/StdGen.html +27 -27
- data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000069.html +23 -0
- data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000070.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000071.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000072.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/StdGen.src/M000073.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TestFailed.html +5 -5
- data/data/rushcheck/rdoc/classes/RushCheck/TestFailed.src/M000107.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TestOptions.html +10 -10
- data/data/rushcheck/rdoc/classes/RushCheck/TestOptions.src/M000067.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TestOptions.src/M000068.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TestResult.html +5 -5
- data/data/rushcheck/rdoc/classes/RushCheck/TestResult.src/M000108.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.html +66 -66
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000052.html +4 -5
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000053.html +4 -7
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000056.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000057.html +4 -4
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000058.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000060.html +19 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000061.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000062.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000064.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/Testable.src/M000065.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.html +38 -21
- data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000109.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000110.html +20 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000111.html +21 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000112.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheck/TheStdGen.src/M000113.html +18 -0
- data/data/rushcheck/rdoc/classes/SpecialString.html +5 -5
- data/data/rushcheck/rdoc/classes/SpecialString.src/M000007.html +37 -0
- data/data/rushcheck/rdoc/classes/String.html +20 -20
- data/data/rushcheck/rdoc/classes/String.src/M000034.html +24 -0
- data/data/rushcheck/rdoc/classes/String.src/M000035.html +18 -0
- data/data/rushcheck/rdoc/classes/String.src/M000036.html +25 -0
- data/data/rushcheck/rdoc/classes/String.src/M000037.html +22 -0
- data/data/rushcheck/rdoc/classes/TrueClass.html +15 -15
- data/data/rushcheck/rdoc/classes/TrueClass.src/M000038.html +18 -0
- data/data/rushcheck/rdoc/classes/TrueClass.src/M000039.html +18 -0
- data/data/rushcheck/rdoc/classes/TrueClass.src/M000040.html +18 -0
- data/data/rushcheck/rdoc/created.rid +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/array_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/assertion_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/bool_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/config_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/gen_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/integer_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/random_rb.html +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/version_rb.html +1 -1
- data/data/rushcheck/rdoc/fr_class_index.html +3 -0
- data/data/rushcheck/rdoc/fr_method_index.html +112 -103
- data/lib/rushcheck/array.rb +58 -17
- data/lib/rushcheck/assertion.rb +1 -1
- data/lib/rushcheck/gen.rb +7 -9
- data/lib/rushcheck/integer.rb +56 -0
- data/lib/rushcheck/property.rb +1 -1
- data/lib/rushcheck/random.rb +5 -1
- data/lib/rushcheck/version.rb +1 -1
- metadata +98 -2
@@ -0,0 +1,20 @@
|
|
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>arbitrary (NonEmptyRandomArray)</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/array.rb, line 85</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arbitrary</span>
|
15
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arrange_len</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">len</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_array</span>(<span class="ruby-identifier">len</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,160 @@
|
|
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: PositiveInteger</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">PositiveInteger</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/rushcheck/integer_rb.html">
|
59
|
+
rushcheck/integer.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="Integer.html">
|
69
|
+
Integer
|
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
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000033">arbitrary</a>
|
92
|
+
<a href="#M000032">random_range</a>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
|
101
|
+
<div id="section">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<!-- if method_list -->
|
111
|
+
<div id="methods">
|
112
|
+
<h3 class="section-bar">Public Class methods</h3>
|
113
|
+
|
114
|
+
<div id="method-M000033" class="method-detail">
|
115
|
+
<a name="M000033"></a>
|
116
|
+
|
117
|
+
<div class="method-heading">
|
118
|
+
<a href="PositiveInteger.src/M000033.html" target="Code" class="method-signature"
|
119
|
+
onclick="popupCode('PositiveInteger.src/M000033.html');return false;">
|
120
|
+
<span class="method-name">arbitrary</span><span class="method-args">()</span>
|
121
|
+
</a>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div class="method-description">
|
125
|
+
<p>
|
126
|
+
this method is needed to use Arbitrary.
|
127
|
+
</p>
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div id="method-M000032" class="method-detail">
|
132
|
+
<a name="M000032"></a>
|
133
|
+
|
134
|
+
<div class="method-heading">
|
135
|
+
<a href="PositiveInteger.src/M000032.html" target="Code" class="method-signature"
|
136
|
+
onclick="popupCode('PositiveInteger.src/M000032.html');return false;">
|
137
|
+
<span class="method-name">random_range</span><span class="method-args">(gen, lo=@@min_bound, hi=@@max_bound)</span>
|
138
|
+
</a>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="method-description">
|
142
|
+
<p>
|
143
|
+
this method is needed to include HsRandom.
|
144
|
+
</p>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
</div>
|
153
|
+
|
154
|
+
|
155
|
+
<div id="validator-badges">
|
156
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
</body>
|
160
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
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>random_range (PositiveInteger)</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/integer.rb, line 56</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">random_range</span>(<span class="ruby-identifier">gen</span>, <span class="ruby-identifier">lo</span>=<span class="ruby-ivar">@@min_bound</span>, <span class="ruby-identifier">hi</span>=<span class="ruby-ivar">@@max_bound</span>)
|
15
|
+
<span class="ruby-identifier">hi</span>, <span class="ruby-identifier">lo</span> = <span class="ruby-identifier">lo</span>, <span class="ruby-identifier">hi</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hi</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">lo</span>
|
16
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">"PositiveInteger requires positive lower bound."</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lo</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
17
|
+
<span class="ruby-identifier">v</span>, <span class="ruby-identifier">g</span> = <span class="ruby-identifier">gen</span>.<span class="ruby-identifier">gen_next</span>
|
18
|
+
<span class="ruby-identifier">d</span> = <span class="ruby-identifier">hi</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lo</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
19
|
+
|
20
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
21
|
+
<span class="ruby-keyword kw">then</span> [<span class="ruby-identifier">lo</span>, <span class="ruby-identifier">g</span>]
|
22
|
+
<span class="ruby-keyword kw">else</span> [(<span class="ruby-identifier">v</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">d</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">lo</span>, <span class="ruby-identifier">g</span>]
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
25
|
+
</body>
|
26
|
+
</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>arbitrary (PositiveInteger)</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/integer.rb, line 69</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arbitrary</span>
|
15
|
+
<span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Gen</span>.<span class="ruby-identifier">sized</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-identifier">n</span> = <span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">n</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
17
|
+
<span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Gen</span>.<span class="ruby-identifier">choose</span>(<span class="ruby-value">1</span>, <span class="ruby-identifier">n</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -94,9 +94,12 @@ href="RandomArray.html">RandomArray</a> to get user defined generators.
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
97
|
+
<a href="#M000016">arbitrary</a>
|
98
|
+
<a href="#M000015">arrange_len</a>
|
99
|
+
<a href="#M000017">coarbitrary</a>
|
100
|
+
<a href="#M000014">create_array</a>
|
101
|
+
<a href="#M000013">create_components</a>
|
102
|
+
<a href="#M000012">set_pattern</a>
|
100
103
|
</div>
|
101
104
|
</div>
|
102
105
|
|
@@ -125,12 +128,12 @@ href="RandomArray.html">RandomArray</a> to get user defined generators.
|
|
125
128
|
<div id="methods">
|
126
129
|
<h3 class="section-bar">Public Class methods</h3>
|
127
130
|
|
128
|
-
<div id="method-
|
129
|
-
<a name="
|
131
|
+
<div id="method-M000016" class="method-detail">
|
132
|
+
<a name="M000016"></a>
|
130
133
|
|
131
134
|
<div class="method-heading">
|
132
|
-
<a href="RandomArray.src/
|
133
|
-
onclick="popupCode('RandomArray.src/
|
135
|
+
<a href="RandomArray.src/M000016.html" target="Code" class="method-signature"
|
136
|
+
onclick="popupCode('RandomArray.src/M000016.html');return false;">
|
134
137
|
<span class="method-name">arbitrary</span><span class="method-args">()</span>
|
135
138
|
</a>
|
136
139
|
</div>
|
@@ -139,28 +142,85 @@ href="RandomArray.html">RandomArray</a> to get user defined generators.
|
|
139
142
|
</div>
|
140
143
|
</div>
|
141
144
|
|
142
|
-
<div id="method-
|
143
|
-
<a name="
|
145
|
+
<div id="method-M000015" class="method-detail">
|
146
|
+
<a name="M000015"></a>
|
144
147
|
|
145
148
|
<div class="method-heading">
|
146
|
-
<a href="RandomArray.src/
|
147
|
-
onclick="popupCode('RandomArray.src/
|
149
|
+
<a href="RandomArray.src/M000015.html" target="Code" class="method-signature"
|
150
|
+
onclick="popupCode('RandomArray.src/M000015.html');return false;">
|
151
|
+
<span class="method-name">arrange_len</span><span class="method-args">() {|len| ...}</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p>
|
157
|
+
a private method for self.arbitrary
|
158
|
+
</p>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div id="method-M000014" class="method-detail">
|
163
|
+
<a name="M000014"></a>
|
164
|
+
|
165
|
+
<div class="method-heading">
|
166
|
+
<a href="RandomArray.src/M000014.html" target="Code" class="method-signature"
|
167
|
+
onclick="popupCode('RandomArray.src/M000014.html');return false;">
|
168
|
+
<span class="method-name">create_array</span><span class="method-args">(len)</span>
|
169
|
+
</a>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<div class="method-description">
|
173
|
+
<p>
|
174
|
+
a private method for self.arbitrary
|
175
|
+
</p>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div id="method-M000013" class="method-detail">
|
180
|
+
<a name="M000013"></a>
|
181
|
+
|
182
|
+
<div class="method-heading">
|
183
|
+
<a href="RandomArray.src/M000013.html" target="Code" class="method-signature"
|
184
|
+
onclick="popupCode('RandomArray.src/M000013.html');return false;">
|
185
|
+
<span class="method-name">create_components</span><span class="method-args">(cs, n, r)</span>
|
186
|
+
</a>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="method-description">
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div id="method-M000012" class="method-detail">
|
194
|
+
<a name="M000012"></a>
|
195
|
+
|
196
|
+
<div class="method-heading">
|
197
|
+
<a href="RandomArray.src/M000012.html" target="Code" class="method-signature"
|
198
|
+
onclick="popupCode('RandomArray.src/M000012.html');return false;">
|
148
199
|
<span class="method-name">set_pattern</span><span class="method-args">(base, &f)</span>
|
149
200
|
</a>
|
150
201
|
</div>
|
151
202
|
|
152
203
|
<div class="method-description">
|
204
|
+
<p>
|
205
|
+
self.set_pattern must be executed before calling self.arbitrary.
|
206
|
+
self.set_pattern defines pattern of random arrays for self.arbitrary.
|
207
|
+
self.set_pattern takes a variable and a block, where the variable should be
|
208
|
+
a class which is used for the first element of random array. On the other
|
209
|
+
hand, the block should define random array by inductive way; the block
|
210
|
+
takes two variables and the first variable is assumed as an array and the
|
211
|
+
second variable is the index of array.
|
212
|
+
</p>
|
153
213
|
</div>
|
154
214
|
</div>
|
155
215
|
|
156
216
|
<h3 class="section-bar">Public Instance methods</h3>
|
157
217
|
|
158
|
-
<div id="method-
|
159
|
-
<a name="
|
218
|
+
<div id="method-M000017" class="method-detail">
|
219
|
+
<a name="M000017"></a>
|
160
220
|
|
161
221
|
<div class="method-heading">
|
162
|
-
<a href="RandomArray.src/
|
163
|
-
onclick="popupCode('RandomArray.src/
|
222
|
+
<a href="RandomArray.src/M000017.html" target="Code" class="method-signature"
|
223
|
+
onclick="popupCode('RandomArray.src/M000017.html');return false;">
|
164
224
|
<span class="method-name">coarbitrary</span><span class="method-args">(g)</span>
|
165
225
|
</a>
|
166
226
|
</div>
|
@@ -0,0 +1,19 @@
|
|
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>set_pattern (RandomArray)</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/array.rb, line 24</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set_pattern</span>(<span class="ruby-identifier">base</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">f</span>)
|
15
|
+
<span class="ruby-ivar">@@base</span>, <span class="ruby-ivar">@@indp</span> = <span class="ruby-identifier">base</span>, <span class="ruby-identifier">f</span>
|
16
|
+
<span class="ruby-keyword kw">nil</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
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>create_components (RandomArray)</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/array.rb, line 29</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_components</span>(<span class="ruby-identifier">cs</span>, <span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>)
|
15
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">cs</span>
|
16
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Class</span>
|
17
|
+
<span class="ruby-identifier">cs</span>.<span class="ruby-identifier">arbitrary</span>.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>)
|
18
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span>
|
19
|
+
<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-keyword kw">self</span>.<span class="ruby-identifier">create_components</span>(<span class="ruby-identifier">c</span>, <span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>)}
|
20
|
+
<span class="ruby-keyword kw">else</span>
|
21
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">"Unexpected arguments #{cs.inspect}. Maybe forgotten calling set_pattern before?"</span>
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
23
|
+
<span class="ruby-keyword kw">end</span></pre>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,27 @@
|
|
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>create_array (RandomArray)</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/array.rb, line 41</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_array</span>(<span class="ruby-identifier">len</span>)
|
15
|
+
<span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Gen</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
|
+
<span class="ruby-identifier">ary</span> = [<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_components</span>(<span class="ruby-ivar">@@base</span>, <span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>)]
|
17
|
+
<span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
|
18
|
+
(<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-identifier">len</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
19
|
+
<span class="ruby-identifier">r1</span>, <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r2</span>.<span class="ruby-identifier">split</span>
|
20
|
+
<span class="ruby-identifier">ary</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_components</span>(<span class="ruby-ivar">@@indp</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">ary</span>, <span class="ruby-identifier">i</span>), <span class="ruby-identifier">n</span>, <span class="ruby-identifier">r1</span>)
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
22
|
+
|
23
|
+
<span class="ruby-identifier">ary</span>
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
25
|
+
<span class="ruby-keyword kw">end</span></pre>
|
26
|
+
</body>
|
27
|
+
</html>
|
@@ -0,0 +1,23 @@
|
|
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>arrange_len (RandomArray)</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/array.rb, line 55</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arrange_len</span>
|
15
|
+
<span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Gen</span>.<span class="ruby-identifier">sized</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
16
|
+
<span class="ruby-identifier">m</span> = <span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">m</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span> <span class="ruby-operator"><=</span> <span class="ruby-value">0</span>
|
17
|
+
<span class="ruby-constant">RushCheck</span><span class="ruby-operator">::</span><span class="ruby-constant">Gen</span>.<span class="ruby-identifier">choose</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">m</span>).<span class="ruby-identifier">bind</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">len</span><span class="ruby-operator">|</span>
|
18
|
+
<span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">len</span>
|
19
|
+
<span class="ruby-keyword kw">end</span>
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
21
|
+
<span class="ruby-keyword kw">end</span></pre>
|
22
|
+
</body>
|
23
|
+
</html>
|