rushcheck 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/Rakefile +1 -1
  2. data/data/rushcheck/doc/policy.txt +107 -0
  3. data/data/rushcheck/doc/rushcheck.thtml +832 -0
  4. data/data/rushcheck/examples/candy.rb +6 -8
  5. data/data/rushcheck/examples/printf.rb +3 -3
  6. data/data/rushcheck/examples/proc.rb +4 -4
  7. data/data/rushcheck/examples/roguetile.rb +16 -16
  8. data/data/rushcheck/examples/sample.rb +10 -10
  9. data/data/rushcheck/rdoc/classes/Arbitrary.html +5 -5
  10. data/data/rushcheck/rdoc/classes/Arbitrary.src/M000082.html +18 -0
  11. data/data/rushcheck/rdoc/classes/Assertion.html +11 -11
  12. data/data/rushcheck/rdoc/classes/Assertion.src/M000019.html +20 -0
  13. data/data/rushcheck/rdoc/classes/Assertion.src/M000020.html +50 -0
  14. data/data/rushcheck/rdoc/classes/Coarbitrary.html +5 -5
  15. data/data/rushcheck/rdoc/classes/Coarbitrary.src/M000105.html +18 -0
  16. data/data/rushcheck/rdoc/classes/FalseClass.html +15 -15
  17. data/data/rushcheck/rdoc/classes/FalseClass.src/M000022.html +18 -0
  18. data/data/rushcheck/rdoc/classes/FalseClass.src/M000023.html +18 -0
  19. data/data/rushcheck/rdoc/classes/FalseClass.src/M000024.html +18 -0
  20. data/data/rushcheck/rdoc/classes/Float.html +20 -20
  21. data/data/rushcheck/rdoc/classes/Float.src/M000052.html +21 -0
  22. data/data/rushcheck/rdoc/classes/Float.src/M000053.html +18 -0
  23. data/data/rushcheck/rdoc/classes/Float.src/M000054.html +22 -0
  24. data/data/rushcheck/rdoc/classes/Float.src/M000055.html +20 -0
  25. data/data/rushcheck/rdoc/classes/Gen.html +102 -102
  26. data/data/rushcheck/rdoc/classes/Gen.src/M000030.html +4 -10
  27. data/data/rushcheck/rdoc/classes/Gen.src/M000031.html +29 -4
  28. data/data/rushcheck/rdoc/classes/Gen.src/M000032.html +6 -4
  29. data/data/rushcheck/rdoc/classes/Gen.src/M000033.html +14 -4
  30. data/data/rushcheck/rdoc/classes/Gen.src/M000034.html +10 -4
  31. data/data/rushcheck/rdoc/classes/Gen.src/M000035.html +4 -4
  32. data/data/rushcheck/rdoc/classes/Gen.src/M000036.html +4 -10
  33. data/data/rushcheck/rdoc/classes/Gen.src/M000037.html +4 -4
  34. data/data/rushcheck/rdoc/classes/Gen.src/M000038.html +4 -7
  35. data/data/rushcheck/rdoc/classes/Gen.src/M000039.html +4 -4
  36. data/data/rushcheck/rdoc/classes/Gen.src/M000040.html +10 -4
  37. data/data/rushcheck/rdoc/classes/Gen.src/M000041.html +4 -9
  38. data/data/rushcheck/rdoc/classes/Gen.src/M000042.html +7 -5
  39. data/data/rushcheck/rdoc/classes/Gen.src/M000043.html +4 -4
  40. data/data/rushcheck/rdoc/classes/Gen.src/M000044.html +4 -10
  41. data/data/rushcheck/rdoc/classes/Gen.src/M000045.html +23 -0
  42. data/data/rushcheck/rdoc/classes/Gen.src/M000046.html +19 -0
  43. data/data/rushcheck/rdoc/classes/Gen.src/M000047.html +18 -0
  44. data/data/rushcheck/rdoc/classes/Gen.src/M000048.html +24 -0
  45. data/data/rushcheck/rdoc/classes/Guard.html +10 -10
  46. data/data/rushcheck/rdoc/classes/Guard.src/M000028.html +27 -0
  47. data/data/rushcheck/rdoc/classes/Guard.src/M000029.html +18 -0
  48. data/data/rushcheck/rdoc/classes/HsRandom.html +20 -20
  49. data/data/rushcheck/rdoc/classes/HsRandom.src/M000088.html +22 -0
  50. data/data/rushcheck/rdoc/classes/HsRandom.src/M000089.html +32 -0
  51. data/data/rushcheck/rdoc/classes/HsRandom.src/M000090.html +18 -0
  52. data/data/rushcheck/rdoc/classes/Integer.html +20 -20
  53. data/data/rushcheck/rdoc/classes/Integer.src/M000010.html +18 -0
  54. data/data/rushcheck/rdoc/classes/Integer.src/M000011.html +18 -0
  55. data/data/rushcheck/rdoc/classes/Integer.src/M000012.html +21 -0
  56. data/data/rushcheck/rdoc/classes/Integer.src/M000013.html +19 -0
  57. data/data/rushcheck/rdoc/classes/NilClass.html +15 -15
  58. data/data/rushcheck/rdoc/classes/NilClass.src/M000064.html +18 -0
  59. data/data/rushcheck/rdoc/classes/NilClass.src/M000065.html +18 -0
  60. data/data/rushcheck/rdoc/classes/NilClass.src/M000066.html +18 -0
  61. data/data/rushcheck/rdoc/classes/Property.html +10 -10
  62. data/data/rushcheck/rdoc/classes/Property.src/M000077.html +26 -0
  63. data/data/rushcheck/rdoc/classes/Property.src/M000078.html +18 -0
  64. data/data/rushcheck/rdoc/classes/RandomArray.html +15 -15
  65. data/data/rushcheck/rdoc/classes/RandomArray.src/M000025.html +18 -0
  66. data/data/rushcheck/rdoc/classes/RandomArray.src/M000026.html +35 -0
  67. data/data/rushcheck/rdoc/classes/RandomArray.src/M000027.html +22 -0
  68. data/data/rushcheck/rdoc/classes/RandomBool.html +10 -10
  69. data/data/rushcheck/rdoc/classes/RandomBool.src/M000086.html +18 -0
  70. data/data/rushcheck/rdoc/classes/RandomBool.src/M000087.html +19 -0
  71. data/data/rushcheck/rdoc/classes/RandomGen.html +20 -20
  72. data/data/rushcheck/rdoc/classes/RandomGen.src/M000083.html +18 -0
  73. data/data/rushcheck/rdoc/classes/RandomGen.src/M000084.html +18 -0
  74. data/data/rushcheck/rdoc/classes/RandomGen.src/M000085.html +18 -0
  75. data/data/rushcheck/rdoc/classes/RandomHash.html +16 -16
  76. data/data/rushcheck/rdoc/classes/RandomHash.src/M000049.html +18 -0
  77. data/data/rushcheck/rdoc/classes/RandomHash.src/M000050.html +26 -0
  78. data/data/rushcheck/rdoc/classes/RandomHash.src/M000051.html +22 -0
  79. data/data/rushcheck/rdoc/classes/RandomProc.html +20 -20
  80. data/data/rushcheck/rdoc/classes/RandomProc.src/M000060.html +18 -0
  81. data/data/rushcheck/rdoc/classes/RandomProc.src/M000061.html +30 -0
  82. data/data/rushcheck/rdoc/classes/RandomProc.src/M000062.html +26 -0
  83. data/data/rushcheck/rdoc/classes/RandomProc.src/M000063.html +20 -0
  84. data/data/rushcheck/rdoc/classes/Result.html +19 -19
  85. data/data/rushcheck/rdoc/classes/Result.src/M000056.html +18 -0
  86. data/data/rushcheck/rdoc/classes/Result.src/M000057.html +18 -0
  87. data/data/rushcheck/rdoc/classes/Result.src/M000058.html +18 -0
  88. data/data/rushcheck/rdoc/classes/RushCheckConfig.html +41 -11
  89. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000001.html +1 -1
  90. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000002.html +1 -1
  91. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000003.html +8 -4
  92. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000004.html +4 -24
  93. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000005.html +22 -39
  94. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000006.html +55 -0
  95. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000007.html +50 -0
  96. data/data/rushcheck/rdoc/classes/SpecialString.html +5 -5
  97. data/data/rushcheck/rdoc/classes/SpecialString.src/M000021.html +37 -0
  98. data/data/rushcheck/rdoc/classes/StdGen.html +27 -27
  99. data/data/rushcheck/rdoc/classes/StdGen.src/M000014.html +9 -4
  100. data/data/rushcheck/rdoc/classes/StdGen.src/M000015.html +21 -0
  101. data/data/rushcheck/rdoc/classes/StdGen.src/M000016.html +21 -0
  102. data/data/rushcheck/rdoc/classes/StdGen.src/M000017.html +18 -0
  103. data/data/rushcheck/rdoc/classes/StdGen.src/M000018.html +18 -0
  104. data/data/rushcheck/rdoc/classes/String.html +20 -20
  105. data/data/rushcheck/rdoc/classes/String.src/M000073.html +24 -0
  106. data/data/rushcheck/rdoc/classes/String.src/M000074.html +18 -0
  107. data/data/rushcheck/rdoc/classes/String.src/M000075.html +25 -0
  108. data/data/rushcheck/rdoc/classes/String.src/M000076.html +22 -0
  109. data/data/rushcheck/rdoc/classes/TestExausted.html +113 -0
  110. data/data/rushcheck/rdoc/classes/TestFailed.html +155 -0
  111. data/data/rushcheck/rdoc/classes/TestFailed.src/M000067.html +18 -0
  112. data/data/rushcheck/rdoc/classes/TestOk.html +113 -0
  113. data/data/rushcheck/rdoc/classes/TestOptions.html +180 -0
  114. data/data/rushcheck/rdoc/classes/TestOptions.src/M000008.html +18 -0
  115. data/data/rushcheck/rdoc/classes/TestOptions.src/M000009.html +18 -0
  116. data/data/rushcheck/rdoc/classes/TestResult.html +164 -0
  117. data/data/rushcheck/rdoc/classes/TestResult.src/M000068.html +18 -0
  118. data/data/rushcheck/rdoc/classes/Testable.html +96 -51
  119. data/data/rushcheck/rdoc/classes/Testable.src/M000091.html +4 -4
  120. data/data/rushcheck/rdoc/classes/Testable.src/M000092.html +4 -4
  121. data/data/rushcheck/rdoc/classes/Testable.src/M000095.html +4 -4
  122. data/data/rushcheck/rdoc/classes/Testable.src/M000096.html +18 -0
  123. data/data/rushcheck/rdoc/classes/Testable.src/M000097.html +18 -0
  124. data/data/rushcheck/rdoc/classes/Testable.src/M000099.html +19 -0
  125. data/data/rushcheck/rdoc/classes/Testable.src/M000100.html +21 -0
  126. data/data/rushcheck/rdoc/classes/Testable.src/M000101.html +18 -0
  127. data/data/rushcheck/rdoc/classes/Testable.src/M000103.html +18 -0
  128. data/data/rushcheck/rdoc/classes/Testable.src/M000104.html +18 -0
  129. data/data/rushcheck/rdoc/classes/TheStdGen.html +20 -20
  130. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000069.html +18 -0
  131. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000070.html +20 -0
  132. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000071.html +21 -0
  133. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000072.html +18 -0
  134. data/data/rushcheck/rdoc/classes/TrueClass.html +15 -15
  135. data/data/rushcheck/rdoc/classes/TrueClass.src/M000079.html +18 -0
  136. data/data/rushcheck/rdoc/classes/TrueClass.src/M000080.html +18 -0
  137. data/data/rushcheck/rdoc/classes/TrueClass.src/M000081.html +18 -0
  138. data/data/rushcheck/rdoc/created.rid +1 -1
  139. data/data/rushcheck/rdoc/files/rushcheck/config_rb.html +8 -1
  140. data/data/rushcheck/rdoc/files/rushcheck/testable_rb.html +3 -1
  141. data/data/rushcheck/rdoc/files/rushcheck/testoptions_rb.html +109 -0
  142. data/data/rushcheck/rdoc/files/rushcheck/testresult_rb.html +105 -0
  143. data/data/rushcheck/rdoc/files/rushcheck_rb.html +127 -0
  144. data/data/rushcheck/rdoc/fr_class_index.html +5 -0
  145. data/data/rushcheck/rdoc/fr_file_index.html +3 -1
  146. data/data/rushcheck/rdoc/fr_method_index.html +103 -94
  147. data/lib/rushcheck/arbitrary.rb +16 -12
  148. data/lib/rushcheck/array.rb +7 -6
  149. data/lib/rushcheck/assertion.rb +53 -50
  150. data/lib/rushcheck/bool.rb +26 -24
  151. data/lib/rushcheck/config.rb +131 -81
  152. data/lib/rushcheck/float.rb +4 -4
  153. data/lib/rushcheck/gen.rb +194 -182
  154. data/lib/rushcheck/guard.rb +9 -10
  155. data/lib/rushcheck/hash.rb +4 -3
  156. data/lib/rushcheck/integer.rb +11 -6
  157. data/lib/rushcheck/proc.rb +7 -7
  158. data/lib/rushcheck/property.rb +19 -15
  159. data/lib/rushcheck/random.rb +162 -159
  160. data/lib/rushcheck/result.rb +16 -12
  161. data/lib/rushcheck/string.rb +12 -12
  162. data/lib/rushcheck/testable.rb +99 -25
  163. data/lib/rushcheck/testoptions.rb +20 -0
  164. data/lib/rushcheck/testresult.rb +25 -0
  165. data/lib/{rushcheck/rushcheck.rb → rushcheck.rb} +2 -1
  166. metadata +93 -4
  167. 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>&nbsp;&nbsp;
85
+ <a href="rushcheck/assertion_rb.html">rushcheck/assertion</a>&nbsp;&nbsp;
86
+ <a href="rushcheck/gen_rb.html">rushcheck/gen</a>&nbsp;&nbsp;
87
+ <a href="rushcheck/random_rb.html">rushcheck/random</a>&nbsp;&nbsp;
88
+ <a href="rushcheck/testable_rb.html">rushcheck/testable</a>&nbsp;&nbsp;
89
+ <a href="rushcheck/array_rb.html">rushcheck/array</a>&nbsp;&nbsp;
90
+ <a href="rushcheck/bool_rb.html">rushcheck/bool</a>&nbsp;&nbsp;
91
+ <a href="rushcheck/hash_rb.html">rushcheck/hash</a>&nbsp;&nbsp;
92
+ <a href="rushcheck/integer_rb.html">rushcheck/integer</a>&nbsp;&nbsp;
93
+ <a href="rushcheck/float_rb.html">rushcheck/float</a>&nbsp;&nbsp;
94
+ <a href="rushcheck/proc_rb.html">rushcheck/proc</a>&nbsp;&nbsp;
95
+ <a href="rushcheck/string_rb.html">rushcheck/string</a>&nbsp;&nbsp;
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/RandomHash.html#M000046">arbitrary (RandomHash)</a><br />
24
- <a href="classes/Float.html#M000048">arbitrary (Float)</a><br />
25
- <a href="classes/RandomArray.html#M000022">arbitrary (RandomArray)</a><br />
26
- <a href="classes/RandomBool.html#M000080">arbitrary (RandomBool)</a><br />
27
- <a href="classes/Arbitrary.html#M000076">arbitrary (Arbitrary)</a><br />
28
- <a href="classes/RandomProc.html#M000057">arbitrary (RandomProc)</a><br />
29
- <a href="classes/Integer.html#M000007">arbitrary (Integer)</a><br />
30
- <a href="classes/SpecialString.html#M000017">arbitrary (SpecialString)</a><br />
31
- <a href="classes/String.html#M000067">arbitrary (String)</a><br />
32
- <a href="classes/NilClass.html#M000060">arbitrary (NilClass)</a><br />
33
- <a href="classes/Gen.html#M000038">bind (Gen)</a><br />
34
- <a href="classes/TrueClass.html#M000073">bound (TrueClass)</a><br />
35
- <a href="classes/String.html#M000068">bound (String)</a><br />
36
- <a href="classes/Float.html#M000049">bound (Float)</a><br />
37
- <a href="classes/FalseClass.html#M000018">bound (FalseClass)</a><br />
38
- <a href="classes/Integer.html#M000006">bound (Integer)</a><br />
39
- <a href="classes/Testable.html#M000086">check (Testable)</a><br />
40
- <a href="classes/Gen.html#M000026">choose (Gen)</a><br />
41
- <a href="classes/Testable.html#M000089">classify (Testable)</a><br />
42
- <a href="classes/RandomArray.html#M000023">coarbitrary (RandomArray)</a><br />
43
- <a href="classes/Float.html#M000051">coarbitrary (Float)</a><br />
44
- <a href="classes/TrueClass.html#M000074">coarbitrary (TrueClass)</a><br />
45
- <a href="classes/Integer.html#M000009">coarbitrary (Integer)</a><br />
46
- <a href="classes/NilClass.html#M000061">coarbitrary (NilClass)</a><br />
47
- <a href="classes/FalseClass.html#M000019">coarbitrary (FalseClass)</a><br />
48
- <a href="classes/RandomProc.html#M000058">coarbitrary (RandomProc)</a><br />
49
- <a href="classes/RandomHash.html#M000047">coarbitrary (RandomHash)</a><br />
50
- <a href="classes/String.html#M000070">coarbitrary (String)</a><br />
51
- <a href="classes/Coarbitrary.html#M000096">coarbitrary (Coarbitrary)</a><br />
52
- <a href="classes/Testable.html#M000092">collect (Testable)</a><br />
53
- <a href="classes/Gen.html#M000027">create (Gen)</a><br />
54
- <a href="classes/RushCheckConfig.html#M000004">done (RushCheckConfig)</a><br />
55
- <a href="classes/Gen.html#M000028">elements (Gen)</a><br />
56
- <a href="classes/Gen.html#M000040">fmap (Gen)</a><br />
57
- <a href="classes/Gen.html#M000041">forall (Gen)</a><br />
58
- <a href="classes/Gen.html#M000029">frequency (Gen)</a><br />
59
- <a href="classes/TheStdGen.html#M000064">gen_next (TheStdGen)</a><br />
60
- <a href="classes/StdGen.html#M000011">gen_next (StdGen)</a><br />
61
- <a href="classes/RandomGen.html#M000077">gen_next (RandomGen)</a><br />
62
- <a href="classes/TheStdGen.html#M000066">gen_range (TheStdGen)</a><br />
63
- <a href="classes/StdGen.html#M000013">gen_range (StdGen)</a><br />
64
- <a href="classes/RandomGen.html#M000079">gen_range (RandomGen)</a><br />
65
- <a href="classes/Gen.html#M000042">generate (Gen)</a><br />
66
- <a href="classes/Guard.html#M000025">guard (Guard)</a><br />
67
- <a href="classes/Guard.html#M000024">guard_raise (Guard)</a><br />
68
- <a href="classes/Testable.html#M000090">imply (Testable)</a><br />
69
- <a href="classes/Testable.html#M000091">label (Testable)</a><br />
70
- <a href="classes/Gen.html#M000030">lift_array (Gen)</a><br />
71
- <a href="classes/StdGen.html#M000010">new (StdGen)</a><br />
72
- <a href="classes/Gen.html#M000037">new (Gen)</a><br />
73
- <a href="classes/TheStdGen.html#M000063">new (TheStdGen)</a><br />
74
- <a href="classes/Assertion.html#M000015">new (Assertion)</a><br />
75
- <a href="classes/Result.html#M000053">new (Result)</a><br />
76
- <a href="classes/RushCheckConfig.html#M000003">new (RushCheckConfig)</a><br />
77
- <a href="classes/Property.html#M000071">new (Property)</a><br />
78
- <a href="classes/Result.html#M000052">nothing (Result)</a><br />
79
- <a href="classes/Gen.html#M000031">oneof (Gen)</a><br />
80
- <a href="classes/Gen.html#M000032">promote (Gen)</a><br />
81
- <a href="classes/TrueClass.html#M000075">property (TrueClass)</a><br />
82
- <a href="classes/Testable.html#M000085">property (Testable)</a><br />
83
- <a href="classes/RandomProc.html#M000059">property (RandomProc)</a><br />
84
- <a href="classes/NilClass.html#M000062">property (NilClass)</a><br />
85
- <a href="classes/Result.html#M000055">property (Result)</a><br />
86
- <a href="classes/FalseClass.html#M000020">property (FalseClass)</a><br />
87
- <a href="classes/Property.html#M000072">property (Property)</a><br />
88
- <a href="classes/Assertion.html#M000016">property (Assertion)</a><br />
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#M000087">quick_check (Testable)</a><br />
91
- <a href="classes/Testable.html#M000088">quickcheck (Testable)</a><br />
92
- <a href="classes/Gen.html#M000033">rand (Gen)</a><br />
93
- <a href="classes/HsRandom.html#M000082">random (HsRandom)</a><br />
94
- <a href="classes/HsRandom.html#M000083">random_array (HsRandom)</a><br />
95
- <a href="classes/RandomBool.html#M000081">random_range (RandomBool)</a><br />
96
- <a href="classes/Integer.html#M000008">random_range (Integer)</a><br />
97
- <a href="classes/String.html#M000069">random_range (String)</a><br />
98
- <a href="classes/Float.html#M000050">random_range (Float)</a><br />
99
- <a href="classes/HsRandom.html#M000084">random_std (HsRandom)</a><br />
100
- <a href="classes/Gen.html#M000043">resize (Gen)</a><br />
101
- <a href="classes/Result.html#M000054">result (Result)</a><br />
102
- <a href="classes/RandomArray.html#M000021">set_pattern (RandomArray)</a><br />
103
- <a href="classes/RandomHash.html#M000045">set_pattern (RandomHash)</a><br />
104
- <a href="classes/RandomProc.html#M000056">set_pattern (RandomProc)</a><br />
105
- <a href="classes/Gen.html#M000034">sized (Gen)</a><br />
106
- <a href="classes/StdGen.html#M000012">split (StdGen)</a><br />
107
- <a href="classes/RandomGen.html#M000078">split (RandomGen)</a><br />
108
- <a href="classes/TheStdGen.html#M000065">split (TheStdGen)</a><br />
109
- <a href="classes/Testable.html#M000093">test (Testable)</a><br />
110
- <a href="classes/RushCheckConfig.html#M000005">tests (RushCheckConfig)</a><br />
111
- <a href="classes/StdGen.html#M000014">to_s (StdGen)</a><br />
112
- <a href="classes/Testable.html#M000095">trivial (Testable)</a><br />
113
- <a href="classes/Gen.html#M000035">unit (Gen)</a><br />
114
- <a href="classes/Gen.html#M000039">value (Gen)</a><br />
115
- <a href="classes/Gen.html#M000044">variant (Gen)</a><br />
116
- <a href="classes/Gen.html#M000036">vector (Gen)</a><br />
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#M000094">verbose_check (Testable)</a><br />
127
+ <a href="classes/Testable.html#M000102">verbose_check (Testable)</a><br />
119
128
  </div>
120
129
  </div>
121
130
  </body>
@@ -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 Arbitrary
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
- end
22
+ module Coarbitrary
19
23
 
20
- module Coarbitrary
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
@@ -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..m) do |len|
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|
@@ -7,61 +7,64 @@ require 'rushcheck/property'
7
7
  require 'rushcheck/result'
8
8
  require 'rushcheck/testable'
9
9
 
10
- # Assertion class is one of main features of RushCheck.
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
- def initialize(*xs, &f)
25
- @inputs = xs[0..(f.arity - 1)]
26
- @nguard = f.arity - xs.length
27
- @proc = f
28
- end
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
- def property
31
- Property.new(Gen.new do |n, r|
32
- r2 = r
33
- if @inputs
34
- then
35
- @inputs.map do |c|
36
- r1, r2 = r2.split
37
- c.arbitrary.value(n, r1)
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
- else
40
- []
41
- end
42
- end.bind do |args|
43
- guards = @nguard >= 0 ? Array.new(@nguard, Guard.new) : []
44
- test = begin
45
- xs = args + guards
46
- @proc.call(*xs)
47
- rescue Exception => ex
48
- case ex
49
- when RushCheckGuard
50
- Result.new(nil)
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
- end
57
- # not use ensure here because ensure clause
58
- # does not return values
59
- test.property.gen.bind do |res|
60
- res.arguments << args.inspect
61
- Gen.unit(res)
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
- end)
64
+
65
+ RushCheck::Property.new(g)
66
+ end
67
+
64
68
  end
65
69
 
66
70
  end
67
-