rushcheck 0.3 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/data/rushcheck/doc/policy.txt +107 -0
- data/data/rushcheck/doc/rushcheck.thtml +832 -0
- data/data/rushcheck/examples/candy.rb +6 -8
- data/data/rushcheck/examples/printf.rb +3 -3
- data/data/rushcheck/examples/proc.rb +4 -4
- data/data/rushcheck/examples/roguetile.rb +16 -16
- data/data/rushcheck/examples/sample.rb +10 -10
- data/data/rushcheck/rdoc/classes/Arbitrary.html +5 -5
- data/data/rushcheck/rdoc/classes/Arbitrary.src/M000082.html +18 -0
- data/data/rushcheck/rdoc/classes/Assertion.html +11 -11
- data/data/rushcheck/rdoc/classes/Assertion.src/M000019.html +20 -0
- data/data/rushcheck/rdoc/classes/Assertion.src/M000020.html +50 -0
- data/data/rushcheck/rdoc/classes/Coarbitrary.html +5 -5
- data/data/rushcheck/rdoc/classes/Coarbitrary.src/M000105.html +18 -0
- data/data/rushcheck/rdoc/classes/FalseClass.html +15 -15
- data/data/rushcheck/rdoc/classes/FalseClass.src/M000022.html +18 -0
- data/data/rushcheck/rdoc/classes/FalseClass.src/M000023.html +18 -0
- data/data/rushcheck/rdoc/classes/FalseClass.src/M000024.html +18 -0
- data/data/rushcheck/rdoc/classes/Float.html +20 -20
- data/data/rushcheck/rdoc/classes/Float.src/M000052.html +21 -0
- data/data/rushcheck/rdoc/classes/Float.src/M000053.html +18 -0
- data/data/rushcheck/rdoc/classes/Float.src/M000054.html +22 -0
- data/data/rushcheck/rdoc/classes/Float.src/M000055.html +20 -0
- data/data/rushcheck/rdoc/classes/Gen.html +102 -102
- data/data/rushcheck/rdoc/classes/Gen.src/M000030.html +4 -10
- data/data/rushcheck/rdoc/classes/Gen.src/M000031.html +29 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000032.html +6 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000033.html +14 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000034.html +10 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000035.html +4 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000036.html +4 -10
- data/data/rushcheck/rdoc/classes/Gen.src/M000037.html +4 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000038.html +4 -7
- data/data/rushcheck/rdoc/classes/Gen.src/M000039.html +4 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000040.html +10 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000041.html +4 -9
- data/data/rushcheck/rdoc/classes/Gen.src/M000042.html +7 -5
- data/data/rushcheck/rdoc/classes/Gen.src/M000043.html +4 -4
- data/data/rushcheck/rdoc/classes/Gen.src/M000044.html +4 -10
- data/data/rushcheck/rdoc/classes/Gen.src/M000045.html +23 -0
- data/data/rushcheck/rdoc/classes/Gen.src/M000046.html +19 -0
- data/data/rushcheck/rdoc/classes/Gen.src/M000047.html +18 -0
- data/data/rushcheck/rdoc/classes/Gen.src/M000048.html +24 -0
- data/data/rushcheck/rdoc/classes/Guard.html +10 -10
- data/data/rushcheck/rdoc/classes/Guard.src/M000028.html +27 -0
- data/data/rushcheck/rdoc/classes/Guard.src/M000029.html +18 -0
- data/data/rushcheck/rdoc/classes/HsRandom.html +20 -20
- data/data/rushcheck/rdoc/classes/HsRandom.src/M000088.html +22 -0
- data/data/rushcheck/rdoc/classes/HsRandom.src/M000089.html +32 -0
- data/data/rushcheck/rdoc/classes/HsRandom.src/M000090.html +18 -0
- data/data/rushcheck/rdoc/classes/Integer.html +20 -20
- data/data/rushcheck/rdoc/classes/Integer.src/M000010.html +18 -0
- data/data/rushcheck/rdoc/classes/Integer.src/M000011.html +18 -0
- data/data/rushcheck/rdoc/classes/Integer.src/M000012.html +21 -0
- data/data/rushcheck/rdoc/classes/Integer.src/M000013.html +19 -0
- data/data/rushcheck/rdoc/classes/NilClass.html +15 -15
- data/data/rushcheck/rdoc/classes/NilClass.src/M000064.html +18 -0
- data/data/rushcheck/rdoc/classes/NilClass.src/M000065.html +18 -0
- data/data/rushcheck/rdoc/classes/NilClass.src/M000066.html +18 -0
- data/data/rushcheck/rdoc/classes/Property.html +10 -10
- data/data/rushcheck/rdoc/classes/Property.src/M000077.html +26 -0
- data/data/rushcheck/rdoc/classes/Property.src/M000078.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomArray.html +15 -15
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000025.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000026.html +35 -0
- data/data/rushcheck/rdoc/classes/RandomArray.src/M000027.html +22 -0
- data/data/rushcheck/rdoc/classes/RandomBool.html +10 -10
- data/data/rushcheck/rdoc/classes/RandomBool.src/M000086.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomBool.src/M000087.html +19 -0
- data/data/rushcheck/rdoc/classes/RandomGen.html +20 -20
- data/data/rushcheck/rdoc/classes/RandomGen.src/M000083.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomGen.src/M000084.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomGen.src/M000085.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomHash.html +16 -16
- data/data/rushcheck/rdoc/classes/RandomHash.src/M000049.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomHash.src/M000050.html +26 -0
- data/data/rushcheck/rdoc/classes/RandomHash.src/M000051.html +22 -0
- data/data/rushcheck/rdoc/classes/RandomProc.html +20 -20
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000060.html +18 -0
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000061.html +30 -0
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000062.html +26 -0
- data/data/rushcheck/rdoc/classes/RandomProc.src/M000063.html +20 -0
- data/data/rushcheck/rdoc/classes/Result.html +19 -19
- data/data/rushcheck/rdoc/classes/Result.src/M000056.html +18 -0
- data/data/rushcheck/rdoc/classes/Result.src/M000057.html +18 -0
- data/data/rushcheck/rdoc/classes/Result.src/M000058.html +18 -0
- data/data/rushcheck/rdoc/classes/RushCheckConfig.html +41 -11
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000001.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000002.html +1 -1
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000003.html +8 -4
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000004.html +4 -24
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000005.html +22 -39
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000006.html +55 -0
- data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000007.html +50 -0
- data/data/rushcheck/rdoc/classes/SpecialString.html +5 -5
- data/data/rushcheck/rdoc/classes/SpecialString.src/M000021.html +37 -0
- data/data/rushcheck/rdoc/classes/StdGen.html +27 -27
- data/data/rushcheck/rdoc/classes/StdGen.src/M000014.html +9 -4
- data/data/rushcheck/rdoc/classes/StdGen.src/M000015.html +21 -0
- data/data/rushcheck/rdoc/classes/StdGen.src/M000016.html +21 -0
- data/data/rushcheck/rdoc/classes/StdGen.src/M000017.html +18 -0
- data/data/rushcheck/rdoc/classes/StdGen.src/M000018.html +18 -0
- data/data/rushcheck/rdoc/classes/String.html +20 -20
- data/data/rushcheck/rdoc/classes/String.src/M000073.html +24 -0
- data/data/rushcheck/rdoc/classes/String.src/M000074.html +18 -0
- data/data/rushcheck/rdoc/classes/String.src/M000075.html +25 -0
- data/data/rushcheck/rdoc/classes/String.src/M000076.html +22 -0
- data/data/rushcheck/rdoc/classes/TestExausted.html +113 -0
- data/data/rushcheck/rdoc/classes/TestFailed.html +155 -0
- data/data/rushcheck/rdoc/classes/TestFailed.src/M000067.html +18 -0
- data/data/rushcheck/rdoc/classes/TestOk.html +113 -0
- data/data/rushcheck/rdoc/classes/TestOptions.html +180 -0
- data/data/rushcheck/rdoc/classes/TestOptions.src/M000008.html +18 -0
- data/data/rushcheck/rdoc/classes/TestOptions.src/M000009.html +18 -0
- data/data/rushcheck/rdoc/classes/TestResult.html +164 -0
- data/data/rushcheck/rdoc/classes/TestResult.src/M000068.html +18 -0
- data/data/rushcheck/rdoc/classes/Testable.html +96 -51
- data/data/rushcheck/rdoc/classes/Testable.src/M000091.html +4 -4
- data/data/rushcheck/rdoc/classes/Testable.src/M000092.html +4 -4
- data/data/rushcheck/rdoc/classes/Testable.src/M000095.html +4 -4
- data/data/rushcheck/rdoc/classes/Testable.src/M000096.html +18 -0
- data/data/rushcheck/rdoc/classes/Testable.src/M000097.html +18 -0
- data/data/rushcheck/rdoc/classes/Testable.src/M000099.html +19 -0
- data/data/rushcheck/rdoc/classes/Testable.src/M000100.html +21 -0
- data/data/rushcheck/rdoc/classes/Testable.src/M000101.html +18 -0
- data/data/rushcheck/rdoc/classes/Testable.src/M000103.html +18 -0
- data/data/rushcheck/rdoc/classes/Testable.src/M000104.html +18 -0
- data/data/rushcheck/rdoc/classes/TheStdGen.html +20 -20
- data/data/rushcheck/rdoc/classes/TheStdGen.src/M000069.html +18 -0
- data/data/rushcheck/rdoc/classes/TheStdGen.src/M000070.html +20 -0
- data/data/rushcheck/rdoc/classes/TheStdGen.src/M000071.html +21 -0
- data/data/rushcheck/rdoc/classes/TheStdGen.src/M000072.html +18 -0
- data/data/rushcheck/rdoc/classes/TrueClass.html +15 -15
- data/data/rushcheck/rdoc/classes/TrueClass.src/M000079.html +18 -0
- data/data/rushcheck/rdoc/classes/TrueClass.src/M000080.html +18 -0
- data/data/rushcheck/rdoc/classes/TrueClass.src/M000081.html +18 -0
- data/data/rushcheck/rdoc/created.rid +1 -1
- data/data/rushcheck/rdoc/files/rushcheck/config_rb.html +8 -1
- data/data/rushcheck/rdoc/files/rushcheck/testable_rb.html +3 -1
- data/data/rushcheck/rdoc/files/rushcheck/testoptions_rb.html +109 -0
- data/data/rushcheck/rdoc/files/rushcheck/testresult_rb.html +105 -0
- data/data/rushcheck/rdoc/files/rushcheck_rb.html +127 -0
- data/data/rushcheck/rdoc/fr_class_index.html +5 -0
- data/data/rushcheck/rdoc/fr_file_index.html +3 -1
- data/data/rushcheck/rdoc/fr_method_index.html +103 -94
- data/lib/rushcheck/arbitrary.rb +16 -12
- data/lib/rushcheck/array.rb +7 -6
- data/lib/rushcheck/assertion.rb +53 -50
- data/lib/rushcheck/bool.rb +26 -24
- data/lib/rushcheck/config.rb +131 -81
- data/lib/rushcheck/float.rb +4 -4
- data/lib/rushcheck/gen.rb +194 -182
- data/lib/rushcheck/guard.rb +9 -10
- data/lib/rushcheck/hash.rb +4 -3
- data/lib/rushcheck/integer.rb +11 -6
- data/lib/rushcheck/proc.rb +7 -7
- data/lib/rushcheck/property.rb +19 -15
- data/lib/rushcheck/random.rb +162 -159
- data/lib/rushcheck/result.rb +16 -12
- data/lib/rushcheck/string.rb +12 -12
- data/lib/rushcheck/testable.rb +99 -25
- data/lib/rushcheck/testoptions.rb +20 -0
- data/lib/rushcheck/testresult.rb +25 -0
- data/lib/{rushcheck/rushcheck.rb → rushcheck.rb} +2 -1
- metadata +93 -4
- data/data/rushcheck/doc/rushcheck.txt +0 -670
@@ -0,0 +1,127 @@
|
|
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>File: rushcheck.rb</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="fileHeader">
|
50
|
+
<h1>rushcheck.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>rushcheck.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Wed Aug 09 02:07:57 JST 2006</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<h1>rushcheck.rb</h1>
|
73
|
+
<p>
|
74
|
+
this is just a prelude include file this provides all of feature of
|
75
|
+
RushCheck for random testing.
|
76
|
+
</p>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="requires-list">
|
81
|
+
<h3 class="section-bar">Required files</h3>
|
82
|
+
|
83
|
+
<div class="name-list">
|
84
|
+
<a href="rushcheck/arbitrary_rb.html">rushcheck/arbitrary</a>
|
85
|
+
<a href="rushcheck/assertion_rb.html">rushcheck/assertion</a>
|
86
|
+
<a href="rushcheck/gen_rb.html">rushcheck/gen</a>
|
87
|
+
<a href="rushcheck/random_rb.html">rushcheck/random</a>
|
88
|
+
<a href="rushcheck/testable_rb.html">rushcheck/testable</a>
|
89
|
+
<a href="rushcheck/array_rb.html">rushcheck/array</a>
|
90
|
+
<a href="rushcheck/bool_rb.html">rushcheck/bool</a>
|
91
|
+
<a href="rushcheck/hash_rb.html">rushcheck/hash</a>
|
92
|
+
<a href="rushcheck/integer_rb.html">rushcheck/integer</a>
|
93
|
+
<a href="rushcheck/float_rb.html">rushcheck/float</a>
|
94
|
+
<a href="rushcheck/proc_rb.html">rushcheck/proc</a>
|
95
|
+
<a href="rushcheck/string_rb.html">rushcheck/string</a>
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<!-- if method_list -->
|
117
|
+
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
<div id="validator-badges">
|
123
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
</body>
|
127
|
+
</html>
|
@@ -42,6 +42,11 @@
|
|
42
42
|
<a href="classes/SpecialString.html">SpecialString</a><br />
|
43
43
|
<a href="classes/StdGen.html">StdGen</a><br />
|
44
44
|
<a href="classes/String.html">String</a><br />
|
45
|
+
<a href="classes/TestExausted.html">TestExausted</a><br />
|
46
|
+
<a href="classes/TestFailed.html">TestFailed</a><br />
|
47
|
+
<a href="classes/TestOk.html">TestOk</a><br />
|
48
|
+
<a href="classes/TestOptions.html">TestOptions</a><br />
|
49
|
+
<a href="classes/TestResult.html">TestResult</a><br />
|
45
50
|
<a href="classes/Testable.html">Testable</a><br />
|
46
51
|
<a href="classes/TheStdGen.html">TheStdGen</a><br />
|
47
52
|
<a href="classes/TrueClass.html">TrueClass</a><br />
|
@@ -20,6 +20,7 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Files</h1>
|
22
22
|
<div id="index-entries">
|
23
|
+
<a href="files/rushcheck_rb.html">rushcheck.rb</a><br />
|
23
24
|
<a href="files/rushcheck/arbitrary_rb.html">rushcheck/arbitrary.rb</a><br />
|
24
25
|
<a href="files/rushcheck/array_rb.html">rushcheck/array.rb</a><br />
|
25
26
|
<a href="files/rushcheck/assertion_rb.html">rushcheck/assertion.rb</a><br />
|
@@ -34,9 +35,10 @@
|
|
34
35
|
<a href="files/rushcheck/property_rb.html">rushcheck/property.rb</a><br />
|
35
36
|
<a href="files/rushcheck/random_rb.html">rushcheck/random.rb</a><br />
|
36
37
|
<a href="files/rushcheck/result_rb.html">rushcheck/result.rb</a><br />
|
37
|
-
<a href="files/rushcheck/rushcheck_rb.html">rushcheck/rushcheck.rb</a><br />
|
38
38
|
<a href="files/rushcheck/string_rb.html">rushcheck/string.rb</a><br />
|
39
39
|
<a href="files/rushcheck/testable_rb.html">rushcheck/testable.rb</a><br />
|
40
|
+
<a href="files/rushcheck/testoptions_rb.html">rushcheck/testoptions.rb</a><br />
|
41
|
+
<a href="files/rushcheck/testresult_rb.html">rushcheck/testresult.rb</a><br />
|
40
42
|
</div>
|
41
43
|
</div>
|
42
44
|
</body>
|
@@ -20,102 +20,111 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/
|
24
|
-
<a href="classes/
|
25
|
-
<a href="classes/
|
26
|
-
<a href="classes/
|
27
|
-
<a href="classes/
|
28
|
-
<a href="classes/
|
29
|
-
<a href="classes/
|
30
|
-
<a href="classes/
|
31
|
-
<a href="classes/
|
32
|
-
<a href="classes/
|
33
|
-
<a href="classes/
|
34
|
-
<a href="classes/
|
35
|
-
<a href="classes/
|
36
|
-
<a href="classes/Float.html#
|
37
|
-
<a href="classes/
|
38
|
-
<a href="classes/Integer.html#
|
39
|
-
<a href="classes/
|
40
|
-
<a href="classes/
|
41
|
-
<a href="classes/
|
42
|
-
<a href="classes/
|
43
|
-
<a href="classes/
|
44
|
-
<a href="classes/
|
45
|
-
<a href="classes/
|
46
|
-
<a href="classes/
|
47
|
-
<a href="classes/
|
48
|
-
<a href="classes/
|
49
|
-
<a href="classes/
|
50
|
-
<a href="classes/
|
51
|
-
<a href="classes/
|
52
|
-
<a href="classes/
|
53
|
-
<a href="classes/
|
54
|
-
<a href="classes/
|
55
|
-
<a href="classes/
|
56
|
-
<a href="classes/
|
57
|
-
<a href="classes/Gen.html#
|
58
|
-
<a href="classes/Gen.html#
|
59
|
-
<a href="classes/
|
60
|
-
<a href="classes/
|
61
|
-
<a href="classes/
|
62
|
-
<a href="classes/
|
63
|
-
<a href="classes/StdGen.html#
|
64
|
-
<a href="classes/
|
65
|
-
<a href="classes/
|
66
|
-
<a href="classes/
|
67
|
-
<a href="classes/
|
68
|
-
<a href="classes/
|
69
|
-
<a href="classes/
|
70
|
-
<a href="classes/
|
71
|
-
<a href="classes/
|
72
|
-
<a href="classes/Gen.html#
|
73
|
-
<a href="classes/
|
74
|
-
<a href="classes/
|
75
|
-
<a href="classes/
|
76
|
-
<a href="classes/
|
77
|
-
<a href="classes/
|
78
|
-
<a href="classes/
|
79
|
-
<a href="classes/
|
80
|
-
<a href="classes/
|
81
|
-
<a href="classes/
|
82
|
-
<a href="classes/
|
83
|
-
<a href="classes/
|
84
|
-
<a href="classes/
|
85
|
-
<a href="classes/
|
86
|
-
<a href="classes/
|
87
|
-
<a href="classes/
|
88
|
-
<a href="classes/
|
23
|
+
<a href="classes/NilClass.html#M000064">arbitrary (NilClass)</a><br />
|
24
|
+
<a href="classes/RandomHash.html#M000050">arbitrary (RandomHash)</a><br />
|
25
|
+
<a href="classes/RandomProc.html#M000061">arbitrary (RandomProc)</a><br />
|
26
|
+
<a href="classes/RandomArray.html#M000026">arbitrary (RandomArray)</a><br />
|
27
|
+
<a href="classes/RandomBool.html#M000086">arbitrary (RandomBool)</a><br />
|
28
|
+
<a href="classes/Arbitrary.html#M000082">arbitrary (Arbitrary)</a><br />
|
29
|
+
<a href="classes/Float.html#M000052">arbitrary (Float)</a><br />
|
30
|
+
<a href="classes/String.html#M000073">arbitrary (String)</a><br />
|
31
|
+
<a href="classes/Integer.html#M000011">arbitrary (Integer)</a><br />
|
32
|
+
<a href="classes/SpecialString.html#M000021">arbitrary (SpecialString)</a><br />
|
33
|
+
<a href="classes/RushCheckConfig.html#M000003">batch (RushCheckConfig)</a><br />
|
34
|
+
<a href="classes/Gen.html#M000042">bind (Gen)</a><br />
|
35
|
+
<a href="classes/FalseClass.html#M000022">bound (FalseClass)</a><br />
|
36
|
+
<a href="classes/Float.html#M000053">bound (Float)</a><br />
|
37
|
+
<a href="classes/String.html#M000074">bound (String)</a><br />
|
38
|
+
<a href="classes/Integer.html#M000010">bound (Integer)</a><br />
|
39
|
+
<a href="classes/TrueClass.html#M000079">bound (TrueClass)</a><br />
|
40
|
+
<a href="classes/Testable.html#M000092">check (Testable)</a><br />
|
41
|
+
<a href="classes/Gen.html#M000030">choose (Gen)</a><br />
|
42
|
+
<a href="classes/Testable.html#M000095">classify (Testable)</a><br />
|
43
|
+
<a href="classes/TrueClass.html#M000080">coarbitrary (TrueClass)</a><br />
|
44
|
+
<a href="classes/RandomProc.html#M000062">coarbitrary (RandomProc)</a><br />
|
45
|
+
<a href="classes/FalseClass.html#M000023">coarbitrary (FalseClass)</a><br />
|
46
|
+
<a href="classes/String.html#M000076">coarbitrary (String)</a><br />
|
47
|
+
<a href="classes/RandomHash.html#M000051">coarbitrary (RandomHash)</a><br />
|
48
|
+
<a href="classes/Integer.html#M000013">coarbitrary (Integer)</a><br />
|
49
|
+
<a href="classes/RandomArray.html#M000027">coarbitrary (RandomArray)</a><br />
|
50
|
+
<a href="classes/Float.html#M000055">coarbitrary (Float)</a><br />
|
51
|
+
<a href="classes/NilClass.html#M000065">coarbitrary (NilClass)</a><br />
|
52
|
+
<a href="classes/Coarbitrary.html#M000105">coarbitrary (Coarbitrary)</a><br />
|
53
|
+
<a href="classes/Testable.html#M000098">collect (Testable)</a><br />
|
54
|
+
<a href="classes/Gen.html#M000031">create (Gen)</a><br />
|
55
|
+
<a href="classes/TestOptions.html#M000009">debug? (TestOptions)</a><br />
|
56
|
+
<a href="classes/RushCheckConfig.html#M000005">done (RushCheckConfig)</a><br />
|
57
|
+
<a href="classes/Gen.html#M000032">elements (Gen)</a><br />
|
58
|
+
<a href="classes/Gen.html#M000044">fmap (Gen)</a><br />
|
59
|
+
<a href="classes/Gen.html#M000045">forall (Gen)</a><br />
|
60
|
+
<a href="classes/Gen.html#M000033">frequency (Gen)</a><br />
|
61
|
+
<a href="classes/TheStdGen.html#M000070">gen_next (TheStdGen)</a><br />
|
62
|
+
<a href="classes/RandomGen.html#M000083">gen_next (RandomGen)</a><br />
|
63
|
+
<a href="classes/StdGen.html#M000015">gen_next (StdGen)</a><br />
|
64
|
+
<a href="classes/TheStdGen.html#M000072">gen_range (TheStdGen)</a><br />
|
65
|
+
<a href="classes/StdGen.html#M000017">gen_range (StdGen)</a><br />
|
66
|
+
<a href="classes/RandomGen.html#M000085">gen_range (RandomGen)</a><br />
|
67
|
+
<a href="classes/Gen.html#M000046">generate (Gen)</a><br />
|
68
|
+
<a href="classes/Guard.html#M000029">guard (Guard)</a><br />
|
69
|
+
<a href="classes/Guard.html#M000028">guard_raise (Guard)</a><br />
|
70
|
+
<a href="classes/Testable.html#M000096">imply (Testable)</a><br />
|
71
|
+
<a href="classes/Testable.html#M000097">label (Testable)</a><br />
|
72
|
+
<a href="classes/Gen.html#M000034">lift_array (Gen)</a><br />
|
73
|
+
<a href="classes/StdGen.html#M000014">new (StdGen)</a><br />
|
74
|
+
<a href="classes/Property.html#M000077">new (Property)</a><br />
|
75
|
+
<a href="classes/TestOptions.html#M000008">new (TestOptions)</a><br />
|
76
|
+
<a href="classes/TheStdGen.html#M000069">new (TheStdGen)</a><br />
|
77
|
+
<a href="classes/Assertion.html#M000019">new (Assertion)</a><br />
|
78
|
+
<a href="classes/Gen.html#M000041">new (Gen)</a><br />
|
79
|
+
<a href="classes/Result.html#M000057">new (Result)</a><br />
|
80
|
+
<a href="classes/TestFailed.html#M000067">new (TestFailed)</a><br />
|
81
|
+
<a href="classes/RushCheckConfig.html#M000004">new (RushCheckConfig)</a><br />
|
82
|
+
<a href="classes/TestResult.html#M000068">new (TestResult)</a><br />
|
83
|
+
<a href="classes/Result.html#M000056">nothing (Result)</a><br />
|
84
|
+
<a href="classes/Gen.html#M000035">oneof (Gen)</a><br />
|
85
|
+
<a href="classes/Gen.html#M000036">promote (Gen)</a><br />
|
86
|
+
<a href="classes/NilClass.html#M000066">property (NilClass)</a><br />
|
87
|
+
<a href="classes/Result.html#M000059">property (Result)</a><br />
|
88
|
+
<a href="classes/RandomProc.html#M000063">property (RandomProc)</a><br />
|
89
|
+
<a href="classes/TrueClass.html#M000081">property (TrueClass)</a><br />
|
90
|
+
<a href="classes/Testable.html#M000091">property (Testable)</a><br />
|
91
|
+
<a href="classes/FalseClass.html#M000024">property (FalseClass)</a><br />
|
92
|
+
<a href="classes/Assertion.html#M000020">property (Assertion)</a><br />
|
93
|
+
<a href="classes/Property.html#M000078">property (Property)</a><br />
|
89
94
|
<a href="classes/RushCheckConfig.html#M000001">quick (RushCheckConfig)</a><br />
|
90
|
-
<a href="classes/Testable.html#
|
91
|
-
<a href="classes/Testable.html#
|
92
|
-
<a href="classes/Gen.html#
|
93
|
-
<a href="classes/HsRandom.html#
|
94
|
-
<a href="classes/HsRandom.html#
|
95
|
-
<a href="classes/
|
96
|
-
<a href="classes/
|
97
|
-
<a href="classes/String.html#
|
98
|
-
<a href="classes/
|
99
|
-
<a href="classes/HsRandom.html#
|
100
|
-
<a href="classes/Gen.html#
|
101
|
-
<a href="classes/Result.html#
|
102
|
-
<a href="classes/
|
103
|
-
<a href="classes/
|
104
|
-
<a href="classes/
|
105
|
-
<a href="classes/
|
106
|
-
<a href="classes/
|
107
|
-
<a href="classes/
|
108
|
-
<a href="classes/
|
109
|
-
<a href="classes/
|
110
|
-
<a href="classes/
|
111
|
-
<a href="classes/
|
112
|
-
<a href="classes/
|
113
|
-
<a href="classes/
|
114
|
-
<a href="classes/
|
115
|
-
<a href="classes/
|
116
|
-
<a href="classes/
|
95
|
+
<a href="classes/Testable.html#M000093">quick_check (Testable)</a><br />
|
96
|
+
<a href="classes/Testable.html#M000094">quickcheck (Testable)</a><br />
|
97
|
+
<a href="classes/Gen.html#M000037">rand (Gen)</a><br />
|
98
|
+
<a href="classes/HsRandom.html#M000088">random (HsRandom)</a><br />
|
99
|
+
<a href="classes/HsRandom.html#M000089">random_array (HsRandom)</a><br />
|
100
|
+
<a href="classes/Integer.html#M000012">random_range (Integer)</a><br />
|
101
|
+
<a href="classes/Float.html#M000054">random_range (Float)</a><br />
|
102
|
+
<a href="classes/String.html#M000075">random_range (String)</a><br />
|
103
|
+
<a href="classes/RandomBool.html#M000087">random_range (RandomBool)</a><br />
|
104
|
+
<a href="classes/HsRandom.html#M000090">random_std (HsRandom)</a><br />
|
105
|
+
<a href="classes/Gen.html#M000047">resize (Gen)</a><br />
|
106
|
+
<a href="classes/Result.html#M000058">result (Result)</a><br />
|
107
|
+
<a href="classes/Testable.html#M000099">run (Testable)</a><br />
|
108
|
+
<a href="classes/Testable.html#M000100">run_tests (Testable)</a><br />
|
109
|
+
<a href="classes/RandomHash.html#M000049">set_pattern (RandomHash)</a><br />
|
110
|
+
<a href="classes/RandomProc.html#M000060">set_pattern (RandomProc)</a><br />
|
111
|
+
<a href="classes/RandomArray.html#M000025">set_pattern (RandomArray)</a><br />
|
112
|
+
<a href="classes/Gen.html#M000038">sized (Gen)</a><br />
|
113
|
+
<a href="classes/RandomGen.html#M000084">split (RandomGen)</a><br />
|
114
|
+
<a href="classes/StdGen.html#M000016">split (StdGen)</a><br />
|
115
|
+
<a href="classes/TheStdGen.html#M000071">split (TheStdGen)</a><br />
|
116
|
+
<a href="classes/Testable.html#M000101">test (Testable)</a><br />
|
117
|
+
<a href="classes/RushCheckConfig.html#M000007">test_batch (RushCheckConfig)</a><br />
|
118
|
+
<a href="classes/Testable.html#M000103">testcase (Testable)</a><br />
|
119
|
+
<a href="classes/RushCheckConfig.html#M000006">tests (RushCheckConfig)</a><br />
|
120
|
+
<a href="classes/StdGen.html#M000018">to_s (StdGen)</a><br />
|
121
|
+
<a href="classes/Testable.html#M000104">trivial (Testable)</a><br />
|
122
|
+
<a href="classes/Gen.html#M000039">unit (Gen)</a><br />
|
123
|
+
<a href="classes/Gen.html#M000043">value (Gen)</a><br />
|
124
|
+
<a href="classes/Gen.html#M000048">variant (Gen)</a><br />
|
125
|
+
<a href="classes/Gen.html#M000040">vector (Gen)</a><br />
|
117
126
|
<a href="classes/RushCheckConfig.html#M000002">verbose (RushCheckConfig)</a><br />
|
118
|
-
<a href="classes/Testable.html#
|
127
|
+
<a href="classes/Testable.html#M000102">verbose_check (Testable)</a><br />
|
119
128
|
</div>
|
120
129
|
</div>
|
121
130
|
</body>
|
data/lib/rushcheck/arbitrary.rb
CHANGED
@@ -6,23 +6,27 @@
|
|
6
6
|
# However they are abstract methods and should be overrided
|
7
7
|
# in each class after include/extend them.
|
8
8
|
|
9
|
-
module
|
9
|
+
module RushCheck
|
10
|
+
|
11
|
+
module Arbitrary
|
12
|
+
|
13
|
+
# It is assumed that the arbitrary method must be overrided
|
14
|
+
# and return a Gen object with the same class of self.
|
15
|
+
# See also rushcheck/gen.rb.
|
16
|
+
def arbitrary
|
17
|
+
raise(NotImplementedError, "This method should be overrided.")
|
18
|
+
end
|
10
19
|
|
11
|
-
# It is assumed that the arbitrary method must be overrided
|
12
|
-
# and return a Gen object with the same class of self.
|
13
|
-
# See also rushcheck/gen.rb.
|
14
|
-
def arbitrary
|
15
|
-
raise(NotImplementedError, "This method should be overrided.")
|
16
20
|
end
|
17
21
|
|
18
|
-
|
22
|
+
module Coarbitrary
|
19
23
|
|
20
|
-
|
24
|
+
# It is assumed that the coarbitrary method must be overrided
|
25
|
+
# and return a Gen object. See also rushcheck/gen.rb.
|
26
|
+
def coarbitrary(g)
|
27
|
+
raise(NotImplementedError, "This method should be overrided.")
|
28
|
+
end
|
21
29
|
|
22
|
-
# It is assumed that the coarbitrary method must be overrided
|
23
|
-
# and return a Gen object. See also rushcheck/gen.rb.
|
24
|
-
def coarbitrary(g)
|
25
|
-
raise(NotImplementedError, "This method should be overrided.")
|
26
30
|
end
|
27
31
|
|
28
32
|
end
|
data/lib/rushcheck/array.rb
CHANGED
@@ -10,20 +10,21 @@ require 'rushcheck/testable'
|
|
10
10
|
# user defined generators.
|
11
11
|
class RandomArray < Array
|
12
12
|
|
13
|
-
extend Arbitrary
|
14
|
-
include Coarbitrary
|
13
|
+
extend RushCheck::Arbitrary
|
14
|
+
include RushCheck::Coarbitrary
|
15
15
|
|
16
16
|
def self.set_pattern(base, &f)
|
17
17
|
@@base, @@indp = base, f
|
18
|
+
self
|
18
19
|
end
|
19
20
|
|
20
21
|
def self.arbitrary
|
21
|
-
Gen.sized do |m|
|
22
|
-
Gen.choose(0
|
22
|
+
RushCheck::Gen.sized do |m|
|
23
|
+
RushCheck::Gen.choose(0, m).bind do |len|
|
23
24
|
if len = 0
|
24
|
-
then Gen.unit([])
|
25
|
+
then RushCheck::Gen.unit([])
|
25
26
|
else
|
26
|
-
Gen.new do |n, r|
|
27
|
+
RushCheck::Gen.new do |n, r|
|
27
28
|
ary = [@@base.arbitrary.value(n, r)]
|
28
29
|
r2 = r
|
29
30
|
(1..len).each do |i|
|
data/lib/rushcheck/assertion.rb
CHANGED
@@ -7,61 +7,64 @@ require 'rushcheck/property'
|
|
7
7
|
require 'rushcheck/result'
|
8
8
|
require 'rushcheck/testable'
|
9
9
|
|
10
|
-
|
11
|
-
# You can write a testcase for random testing as follows:
|
12
|
-
#
|
13
|
-
# Assertion.new(Integer, String) do |x, y, g|
|
14
|
-
# g.guard { precondition }
|
15
|
-
# body
|
16
|
-
# end
|
17
|
-
#
|
18
|
-
# See also documents and several examples.
|
19
|
-
#
|
20
|
-
class Assertion
|
21
|
-
|
22
|
-
include Testable
|
10
|
+
module RushCheck
|
23
11
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
12
|
+
# Assertion class is one of main features of RushCheck.
|
13
|
+
# You can write a testcase for random testing as follows:
|
14
|
+
#
|
15
|
+
# Assertion.new(Integer, String) do |x, y, g|
|
16
|
+
# g.guard { precondition }
|
17
|
+
# body
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# See also documents and several examples.
|
21
|
+
#
|
22
|
+
class Assertion
|
23
|
+
|
24
|
+
include RushCheck::Testable
|
25
|
+
|
26
|
+
def initialize(*xs, &f)
|
27
|
+
raise ArgumentError unless f.arity == xs.length
|
28
|
+
@inputs = xs[0..(f.arity - 1)]
|
29
|
+
@proc = f
|
30
|
+
end
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
def property
|
33
|
+
g = RushCheck::Gen.new do |n, r|
|
34
|
+
r2 = r
|
35
|
+
if @inputs
|
36
|
+
then
|
37
|
+
@inputs.map do |c|
|
38
|
+
r1, r2 = r2.split
|
39
|
+
c.arbitrary.value(n, r1)
|
40
|
+
end
|
41
|
+
else
|
42
|
+
[]
|
38
43
|
end
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
else
|
52
|
-
err = "Unexpected exception: #{ex.inspect}\n" +
|
53
|
-
ex.backtrace.join("\n")
|
54
|
-
Result.new(false, [], [err])
|
44
|
+
end.bind do |args|
|
45
|
+
test = begin
|
46
|
+
@proc.call(*args)
|
47
|
+
rescue Exception => ex
|
48
|
+
case ex
|
49
|
+
when RushCheck::GuardException
|
50
|
+
RushCheck::Result.new(nil)
|
51
|
+
else
|
52
|
+
err = "Unexpected exception: #{ex.inspect}\n" +
|
53
|
+
ex.backtrace.join("\n")
|
54
|
+
RushCheck::Result.new(false, [], [err])
|
55
|
+
end
|
55
56
|
end
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
# not use ensure here because ensure clause
|
58
|
+
# does not return values
|
59
|
+
test.property.gen.fmap do |res|
|
60
|
+
res.arguments << args.inspect
|
61
|
+
res
|
62
|
+
end
|
62
63
|
end
|
63
|
-
|
64
|
+
|
65
|
+
RushCheck::Property.new(g)
|
66
|
+
end
|
67
|
+
|
64
68
|
end
|
65
69
|
|
66
70
|
end
|
67
|
-
|