rushcheck 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/Rakefile +1 -1
  2. data/data/rushcheck/doc/rushcheck.txt +68 -10
  3. data/data/rushcheck/examples/candy.rb +43 -0
  4. data/data/rushcheck/rdoc/classes/Arbitrary.html +5 -5
  5. data/data/rushcheck/rdoc/classes/Arbitrary.src/M000076.html +18 -0
  6. data/data/rushcheck/rdoc/classes/Assertion.src/M000016.html +9 -4
  7. data/data/rushcheck/rdoc/classes/Coarbitrary.html +5 -5
  8. data/data/rushcheck/rdoc/classes/Coarbitrary.src/M000096.html +18 -0
  9. data/data/rushcheck/rdoc/classes/Float.html +20 -20
  10. data/data/rushcheck/rdoc/classes/Float.src/M000048.html +7 -4
  11. data/data/rushcheck/rdoc/classes/Float.src/M000049.html +4 -8
  12. data/data/rushcheck/rdoc/classes/Float.src/M000050.html +8 -6
  13. data/data/rushcheck/rdoc/classes/Float.src/M000051.html +20 -0
  14. data/data/rushcheck/rdoc/classes/Gen.html +109 -87
  15. data/data/rushcheck/rdoc/classes/Gen.src/M000026.html +1 -1
  16. data/data/rushcheck/rdoc/classes/Gen.src/M000027.html +28 -5
  17. data/data/rushcheck/rdoc/classes/Gen.src/M000028.html +6 -14
  18. data/data/rushcheck/rdoc/classes/Gen.src/M000029.html +13 -9
  19. data/data/rushcheck/rdoc/classes/Gen.src/M000030.html +10 -4
  20. data/data/rushcheck/rdoc/classes/Gen.src/M000031.html +4 -4
  21. data/data/rushcheck/rdoc/classes/Gen.src/M000032.html +4 -4
  22. data/data/rushcheck/rdoc/classes/Gen.src/M000033.html +4 -4
  23. data/data/rushcheck/rdoc/classes/Gen.src/M000034.html +4 -4
  24. data/data/rushcheck/rdoc/classes/Gen.src/M000035.html +4 -10
  25. data/data/rushcheck/rdoc/classes/Gen.src/M000036.html +10 -4
  26. data/data/rushcheck/rdoc/classes/Gen.src/M000037.html +4 -7
  27. data/data/rushcheck/rdoc/classes/Gen.src/M000038.html +7 -4
  28. data/data/rushcheck/rdoc/classes/Gen.src/M000039.html +4 -4
  29. data/data/rushcheck/rdoc/classes/Gen.src/M000040.html +4 -9
  30. data/data/rushcheck/rdoc/classes/Gen.src/M000041.html +9 -5
  31. data/data/rushcheck/rdoc/classes/Gen.src/M000042.html +5 -4
  32. data/data/rushcheck/rdoc/classes/Gen.src/M000043.html +4 -10
  33. data/data/rushcheck/rdoc/classes/Gen.src/M000044.html +24 -0
  34. data/data/rushcheck/rdoc/classes/HsRandom.html +20 -20
  35. data/data/rushcheck/rdoc/classes/HsRandom.src/M000082.html +8 -18
  36. data/data/rushcheck/rdoc/classes/HsRandom.src/M000083.html +18 -4
  37. data/data/rushcheck/rdoc/classes/HsRandom.src/M000084.html +18 -0
  38. data/data/rushcheck/rdoc/classes/NilClass.html +15 -15
  39. data/data/rushcheck/rdoc/classes/NilClass.src/M000060.html +4 -4
  40. data/data/rushcheck/rdoc/classes/NilClass.src/M000061.html +4 -4
  41. data/data/rushcheck/rdoc/classes/NilClass.src/M000062.html +18 -0
  42. data/data/rushcheck/rdoc/classes/Property.html +10 -10
  43. data/data/rushcheck/rdoc/classes/Property.src/M000071.html +12 -4
  44. data/data/rushcheck/rdoc/classes/Property.src/M000072.html +18 -0
  45. data/data/rushcheck/rdoc/classes/RandomArray.src/M000022.html +2 -2
  46. data/data/rushcheck/rdoc/classes/RandomBool.html +10 -10
  47. data/data/rushcheck/rdoc/classes/RandomBool.src/M000080.html +4 -5
  48. data/data/rushcheck/rdoc/classes/RandomBool.src/M000081.html +19 -0
  49. data/data/rushcheck/rdoc/classes/RandomGen.html +20 -20
  50. data/data/rushcheck/rdoc/classes/RandomGen.src/M000077.html +3 -3
  51. data/data/rushcheck/rdoc/classes/RandomGen.src/M000078.html +3 -3
  52. data/data/rushcheck/rdoc/classes/RandomGen.src/M000079.html +18 -0
  53. data/data/rushcheck/rdoc/classes/RandomHash.html +16 -16
  54. data/data/rushcheck/rdoc/classes/RandomHash.src/M000045.html +4 -12
  55. data/data/rushcheck/rdoc/classes/RandomHash.src/M000046.html +11 -7
  56. data/data/rushcheck/rdoc/classes/RandomHash.src/M000047.html +22 -0
  57. data/data/rushcheck/rdoc/classes/RandomProc.html +20 -20
  58. data/data/rushcheck/rdoc/classes/RandomProc.src/M000056.html +4 -16
  59. data/data/rushcheck/rdoc/classes/RandomProc.src/M000057.html +13 -9
  60. data/data/rushcheck/rdoc/classes/RandomProc.src/M000058.html +11 -5
  61. data/data/rushcheck/rdoc/classes/RandomProc.src/M000059.html +20 -0
  62. data/data/rushcheck/rdoc/classes/Result.html +19 -19
  63. data/data/rushcheck/rdoc/classes/Result.src/M000052.html +4 -4
  64. data/data/rushcheck/rdoc/classes/Result.src/M000053.html +4 -4
  65. data/data/rushcheck/rdoc/classes/Result.src/M000054.html +18 -0
  66. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000004.html +1 -1
  67. data/data/rushcheck/rdoc/classes/RushCheckConfig.src/M000005.html +1 -1
  68. data/data/rushcheck/rdoc/classes/String.html +20 -20
  69. data/data/rushcheck/rdoc/classes/String.src/M000067.html +10 -4
  70. data/data/rushcheck/rdoc/classes/String.src/M000068.html +4 -11
  71. data/data/rushcheck/rdoc/classes/String.src/M000069.html +10 -7
  72. data/data/rushcheck/rdoc/classes/String.src/M000070.html +22 -0
  73. data/data/rushcheck/rdoc/classes/Testable.html +54 -54
  74. data/data/rushcheck/rdoc/classes/Testable.src/M000085.html +4 -4
  75. data/data/rushcheck/rdoc/classes/Testable.src/M000086.html +18 -0
  76. data/data/rushcheck/rdoc/classes/Testable.src/M000089.html +4 -4
  77. data/data/rushcheck/rdoc/classes/Testable.src/M000090.html +4 -4
  78. data/data/rushcheck/rdoc/classes/Testable.src/M000091.html +18 -0
  79. data/data/rushcheck/rdoc/classes/Testable.src/M000093.html +18 -0
  80. data/data/rushcheck/rdoc/classes/Testable.src/M000095.html +18 -0
  81. data/data/rushcheck/rdoc/classes/TheStdGen.html +20 -20
  82. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000063.html +4 -6
  83. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000064.html +6 -7
  84. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000065.html +7 -4
  85. data/data/rushcheck/rdoc/classes/TheStdGen.src/M000066.html +18 -0
  86. data/data/rushcheck/rdoc/classes/TrueClass.html +15 -15
  87. data/data/rushcheck/rdoc/classes/TrueClass.src/M000073.html +4 -4
  88. data/data/rushcheck/rdoc/classes/TrueClass.src/M000074.html +4 -4
  89. data/data/rushcheck/rdoc/classes/TrueClass.src/M000075.html +18 -0
  90. data/data/rushcheck/rdoc/created.rid +1 -1
  91. data/data/rushcheck/rdoc/files/rushcheck/array_rb.html +1 -1
  92. data/data/rushcheck/rdoc/files/rushcheck/assertion_rb.html +1 -1
  93. data/data/rushcheck/rdoc/files/rushcheck/config_rb.html +1 -1
  94. data/data/rushcheck/rdoc/files/rushcheck/gen_rb.html +8 -1
  95. data/data/rushcheck/rdoc/files/rushcheck/rushcheck_rb.html +6 -2
  96. data/data/rushcheck/rdoc/files/rushcheck/testable_rb.html +1 -1
  97. data/data/rushcheck/rdoc/fr_method_index.html +75 -74
  98. data/lib/rushcheck/gen.rb +40 -3
  99. metadata +22 -2
@@ -5,14 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>coarbitrary (TrueClass)</title>
8
+ <title>bound (TrueClass)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File rushcheck/bool.rb, line 37</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">g</span>)
15
- <span class="ruby-identifier">g</span>.<span class="ruby-identifier">variant</span>(<span class="ruby-value">0</span>)
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/bool.rb, line 33</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bound</span>
15
+ [<span class="ruby-ivar">@@min_bound</span>, <span class="ruby-ivar">@@max_bound</span>]
16
16
  <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -5,14 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>property (TrueClass)</title>
8
+ <title>coarbitrary (TrueClass)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File rushcheck/bool.rb, line 41</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">property</span>
15
- <span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">result</span>
13
+ <pre><span class="ruby-comment cmt"># File rushcheck/bool.rb, line 37</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">g</span>)
15
+ <span class="ruby-identifier">g</span>.<span class="ruby-identifier">variant</span>(<span class="ruby-value">0</span>)
16
16
  <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>property (TrueClass)</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/bool.rb, line 41</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">property</span>
15
+ <span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>).<span class="ruby-identifier">result</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -1 +1 @@
1
- Tue Aug 08 05:09:19 JST 2006
1
+ Thu Aug 10 00:07:58 JST 2006
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 08 05:09:18 JST 2006</td>
59
+ <td>Wed Aug 09 03:29:41 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 08 05:09:18 JST 2006</td>
59
+ <td>Tue Aug 08 17:24:57 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 08 05:09:18 JST 2006</td>
59
+ <td>Tue Aug 08 18:29:29 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 08 05:09:18 JST 2006</td>
59
+ <td>Wed Aug 09 14:42:20 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -79,6 +79,13 @@ also the Haskell implementation.
79
79
 
80
80
  </div>
81
81
 
82
+ <div id="requires-list">
83
+ <h3 class="section-bar">Required files</h3>
84
+
85
+ <div class="name-list">
86
+ <a href="gen_rb.html">rushcheck/gen</a>&nbsp;&nbsp;
87
+ </div>
88
+ </div>
82
89
 
83
90
  </div>
84
91
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 08 05:09:18 JST 2006</td>
59
+ <td>Wed Aug 09 02:07:57 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -81,6 +81,11 @@ RushCheck for random testing.
81
81
  <h3 class="section-bar">Required files</h3>
82
82
 
83
83
  <div class="name-list">
84
+ <a href="arbitrary_rb.html">rushcheck/arbitrary</a>&nbsp;&nbsp;
85
+ <a href="assertion_rb.html">rushcheck/assertion</a>&nbsp;&nbsp;
86
+ <a href="gen_rb.html">rushcheck/gen</a>&nbsp;&nbsp;
87
+ <a href="random_rb.html">rushcheck/random</a>&nbsp;&nbsp;
88
+ <a href="testable_rb.html">rushcheck/testable</a>&nbsp;&nbsp;
84
89
  <a href="array_rb.html">rushcheck/array</a>&nbsp;&nbsp;
85
90
  <a href="bool_rb.html">rushcheck/bool</a>&nbsp;&nbsp;
86
91
  <a href="hash_rb.html">rushcheck/hash</a>&nbsp;&nbsp;
@@ -88,7 +93,6 @@ RushCheck for random testing.
88
93
  <a href="float_rb.html">rushcheck/float</a>&nbsp;&nbsp;
89
94
  <a href="proc_rb.html">rushcheck/proc</a>&nbsp;&nbsp;
90
95
  <a href="string_rb.html">rushcheck/string</a>&nbsp;&nbsp;
91
- <a href="assertion_rb.html">rushcheck/assertion</a>&nbsp;&nbsp;
92
96
  </div>
93
97
  </div>
94
98
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 08 05:09:18 JST 2006</td>
59
+ <td>Wed Aug 09 02:42:54 JST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -20,101 +20,102 @@
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 />
23
25
  <a href="classes/RandomArray.html#M000022">arbitrary (RandomArray)</a><br />
24
- <a href="classes/Float.html#M000047">arbitrary (Float)</a><br />
25
- <a href="classes/SpecialString.html#M000017">arbitrary (SpecialString)</a><br />
26
- <a href="classes/RandomHash.html#M000045">arbitrary (RandomHash)</a><br />
27
- <a href="classes/Arbitrary.html#M000075">arbitrary (Arbitrary)</a><br />
28
- <a href="classes/String.html#M000066">arbitrary (String)</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
29
  <a href="classes/Integer.html#M000007">arbitrary (Integer)</a><br />
30
- <a href="classes/RandomBool.html#M000079">arbitrary (RandomBool)</a><br />
31
- <a href="classes/NilClass.html#M000059">arbitrary (NilClass)</a><br />
32
- <a href="classes/RandomProc.html#M000056">arbitrary (RandomProc)</a><br />
33
- <a href="classes/Gen.html#M000037">bind (Gen)</a><br />
34
- <a href="classes/Float.html#M000048">bound (Float)</a><br />
35
- <a href="classes/String.html#M000067">bound (String)</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 />
36
37
  <a href="classes/FalseClass.html#M000018">bound (FalseClass)</a><br />
37
38
  <a href="classes/Integer.html#M000006">bound (Integer)</a><br />
38
- <a href="classes/TrueClass.html#M000072">bound (TrueClass)</a><br />
39
- <a href="classes/Testable.html#M000085">check (Testable)</a><br />
39
+ <a href="classes/Testable.html#M000086">check (Testable)</a><br />
40
40
  <a href="classes/Gen.html#M000026">choose (Gen)</a><br />
41
- <a href="classes/Testable.html#M000088">classify (Testable)</a><br />
42
- <a href="classes/Coarbitrary.html#M000095">coarbitrary (Coarbitrary)</a><br />
43
- <a href="classes/FalseClass.html#M000019">coarbitrary (FalseClass)</a><br />
44
- <a href="classes/String.html#M000069">coarbitrary (String)</a><br />
41
+ <a href="classes/Testable.html#M000089">classify (Testable)</a><br />
45
42
  <a href="classes/RandomArray.html#M000023">coarbitrary (RandomArray)</a><br />
46
- <a href="classes/TrueClass.html#M000073">coarbitrary (TrueClass)</a><br />
47
- <a href="classes/RandomHash.html#M000046">coarbitrary (RandomHash)</a><br />
43
+ <a href="classes/Float.html#M000051">coarbitrary (Float)</a><br />
44
+ <a href="classes/TrueClass.html#M000074">coarbitrary (TrueClass)</a><br />
48
45
  <a href="classes/Integer.html#M000009">coarbitrary (Integer)</a><br />
49
- <a href="classes/Float.html#M000050">coarbitrary (Float)</a><br />
50
- <a href="classes/RandomProc.html#M000057">coarbitrary (RandomProc)</a><br />
51
- <a href="classes/NilClass.html#M000060">coarbitrary (NilClass)</a><br />
52
- <a href="classes/Testable.html#M000091">collect (Testable)</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 />
53
54
  <a href="classes/RushCheckConfig.html#M000004">done (RushCheckConfig)</a><br />
54
- <a href="classes/Gen.html#M000027">elements (Gen)</a><br />
55
- <a href="classes/Gen.html#M000039">fmap (Gen)</a><br />
56
- <a href="classes/Gen.html#M000040">forall (Gen)</a><br />
57
- <a href="classes/Gen.html#M000028">frequency (Gen)</a><br />
58
- <a href="classes/TheStdGen.html#M000063">gen_next (TheStdGen)</a><br />
59
- <a href="classes/RandomGen.html#M000076">gen_next (RandomGen)</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
60
  <a href="classes/StdGen.html#M000011">gen_next (StdGen)</a><br />
61
- <a href="classes/RandomGen.html#M000078">gen_range (RandomGen)</a><br />
62
- <a href="classes/TheStdGen.html#M000065">gen_range (TheStdGen)</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
63
  <a href="classes/StdGen.html#M000013">gen_range (StdGen)</a><br />
64
- <a href="classes/Gen.html#M000041">generate (Gen)</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 />
65
66
  <a href="classes/Guard.html#M000025">guard (Guard)</a><br />
66
67
  <a href="classes/Guard.html#M000024">guard_raise (Guard)</a><br />
67
- <a href="classes/Testable.html#M000089">imply (Testable)</a><br />
68
- <a href="classes/Testable.html#M000090">label (Testable)</a><br />
69
- <a href="classes/Gen.html#M000029">lift_array (Gen)</a><br />
70
- <a href="classes/Gen.html#M000036">new (Gen)</a><br />
71
- <a href="classes/TheStdGen.html#M000062">new (TheStdGen)</a><br />
72
- <a href="classes/RushCheckConfig.html#M000003">new (RushCheckConfig)</a><br />
73
- <a href="classes/Assertion.html#M000015">new (Assertion)</a><br />
74
- <a href="classes/Property.html#M000070">new (Property)</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 />
75
71
  <a href="classes/StdGen.html#M000010">new (StdGen)</a><br />
76
- <a href="classes/Result.html#M000052">new (Result)</a><br />
77
- <a href="classes/Result.html#M000051">nothing (Result)</a><br />
78
- <a href="classes/Gen.html#M000030">oneof (Gen)</a><br />
79
- <a href="classes/Gen.html#M000031">promote (Gen)</a><br />
80
- <a href="classes/NilClass.html#M000061">property (NilClass)</a><br />
81
- <a href="classes/Property.html#M000071">property (Property)</a><br />
82
- <a href="classes/Result.html#M000054">property (Result)</a><br />
83
- <a href="classes/RandomProc.html#M000058">property (RandomProc)</a><br />
84
- <a href="classes/Testable.html#M000084">property (Testable)</a><br />
85
- <a href="classes/Assertion.html#M000016">property (Assertion)</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
86
  <a href="classes/FalseClass.html#M000020">property (FalseClass)</a><br />
87
- <a href="classes/TrueClass.html#M000074">property (TrueClass)</a><br />
87
+ <a href="classes/Property.html#M000072">property (Property)</a><br />
88
+ <a href="classes/Assertion.html#M000016">property (Assertion)</a><br />
88
89
  <a href="classes/RushCheckConfig.html#M000001">quick (RushCheckConfig)</a><br />
89
- <a href="classes/Testable.html#M000086">quick_check (Testable)</a><br />
90
- <a href="classes/Testable.html#M000087">quickcheck (Testable)</a><br />
91
- <a href="classes/Gen.html#M000032">rand (Gen)</a><br />
92
- <a href="classes/HsRandom.html#M000081">random (HsRandom)</a><br />
93
- <a href="classes/HsRandom.html#M000082">random_array (HsRandom)</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 />
94
96
  <a href="classes/Integer.html#M000008">random_range (Integer)</a><br />
95
- <a href="classes/String.html#M000068">random_range (String)</a><br />
96
- <a href="classes/RandomBool.html#M000080">random_range (RandomBool)</a><br />
97
- <a href="classes/Float.html#M000049">random_range (Float)</a><br />
98
- <a href="classes/HsRandom.html#M000083">random_std (HsRandom)</a><br />
99
- <a href="classes/Gen.html#M000042">resize (Gen)</a><br />
100
- <a href="classes/Result.html#M000053">result (Result)</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 />
101
102
  <a href="classes/RandomArray.html#M000021">set_pattern (RandomArray)</a><br />
102
- <a href="classes/RandomHash.html#M000044">set_pattern (RandomHash)</a><br />
103
- <a href="classes/RandomProc.html#M000055">set_pattern (RandomProc)</a><br />
104
- <a href="classes/Gen.html#M000033">sized (Gen)</a><br />
105
- <a href="classes/RandomGen.html#M000077">split (RandomGen)</a><br />
106
- <a href="classes/TheStdGen.html#M000064">split (TheStdGen)</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 />
107
106
  <a href="classes/StdGen.html#M000012">split (StdGen)</a><br />
108
- <a href="classes/Testable.html#M000092">test (Testable)</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 />
109
110
  <a href="classes/RushCheckConfig.html#M000005">tests (RushCheckConfig)</a><br />
110
111
  <a href="classes/StdGen.html#M000014">to_s (StdGen)</a><br />
111
- <a href="classes/Testable.html#M000094">trivial (Testable)</a><br />
112
- <a href="classes/Gen.html#M000034">unit (Gen)</a><br />
113
- <a href="classes/Gen.html#M000038">value (Gen)</a><br />
114
- <a href="classes/Gen.html#M000043">variant (Gen)</a><br />
115
- <a href="classes/Gen.html#M000035">vector (Gen)</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 />
116
117
  <a href="classes/RushCheckConfig.html#M000002">verbose (RushCheckConfig)</a><br />
117
- <a href="classes/Testable.html#M000093">verbose_check (Testable)</a><br />
118
+ <a href="classes/Testable.html#M000094">verbose_check (Testable)</a><br />
118
119
  </div>
119
120
  </div>
120
121
  </body>
data/lib/rushcheck/gen.rb CHANGED
@@ -3,9 +3,13 @@
3
3
  # Almost all implementations are similar to Haskell's one.
4
4
  # Therefore check also the Haskell implementation.
5
5
 
6
+ require 'rushcheck/gen'
7
+
6
8
  # Gen provides functions for generating test instances.
7
9
  class Gen
8
10
 
11
+ @@max_create = 10000
12
+
9
13
  # choose is one of primitive generators to create a random Gen object.
10
14
  # choose returns a Gen object which generates a random value in the
11
15
  # bound. It may useful to implement arbitrary method into your class.
@@ -13,6 +17,39 @@ class Gen
13
17
  rand.fmap {|x| lo.class.random(x, lo, hi)[0] }
14
18
  end
15
19
 
20
+ # create is one of primitive generators to create a random Gen object.
21
+ # create takes an array of Gen objects, and any block to generate object.
22
+ # Then create returns a Gen object. It may useful to implement
23
+ # arbitrary method into your class.
24
+ def self.create(xs, &f)
25
+ Gen.new do |n, r|
26
+ r2 = r
27
+ nguard = f.arity - xs.length
28
+ guards = nguard >= 0 ? Array.new(nguard, Guard.new) : []
29
+
30
+ try = 0
31
+ begin
32
+ if try > @@max_create
33
+ raise(RuntimeError, "Failed to guards too many.")
34
+ end
35
+ args = xs.map do |gen|
36
+ r1, r2 = r2.split
37
+ gen.value(n, r1)
38
+ end
39
+ ys = args + guards
40
+ f.call(*ys)
41
+ rescue Exception => ex
42
+ case ex
43
+ when RushCheckGuard
44
+ try += 1
45
+ retry
46
+ else
47
+ raise(ex, ex.to_s)
48
+ end
49
+ end
50
+ end
51
+ end
52
+
16
53
  # elements is one of primitive generators to create a random Gen
17
54
  # object. elements requires an array and returns a Gen object which
18
55
  # generates an object in the array randomly. It may useful to
@@ -50,11 +87,11 @@ class Gen
50
87
  # variable. The block should return a Gen object. lift_array returns
51
88
  # a Gen object which generates an array of the result of given block
52
89
  # for applying each member of given array.
53
- def self.lift_array(ary)
90
+ def self.lift_array(xs)
54
91
  Gen.new do |n, r|
55
92
  r2 = r
56
- ary.map do |c|
57
- r1, r2 = r.split
93
+ xs.map do |c|
94
+ r1, r2 = r2.split
58
95
  yield.value(n, r1)
59
96
  end
60
97
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: rushcheck
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.2"
7
- date: 2006-08-09 00:00:00.000000 +09:00
6
+ version: "0.3"
7
+ date: 2006-08-10 00:00:00.000000 +09:00
8
8
  summary: A lightweight random testing tool
9
9
  require_paths:
10
10
  - lib
@@ -54,6 +54,7 @@ files:
54
54
  - data/rushcheck/rdoc
55
55
  - data/rushcheck/doc/policy.txt
56
56
  - data/rushcheck/doc/rushcheck.txt
57
+ - data/rushcheck/examples/candy.rb
57
58
  - data/rushcheck/examples/printf.rb
58
59
  - data/rushcheck/examples/proc.rb
59
60
  - data/rushcheck/examples/roguetile.rb
@@ -116,9 +117,11 @@ files:
116
117
  - data/rushcheck/rdoc/classes/TrueClass.html
117
118
  - data/rushcheck/rdoc/classes/TrueClass.src
118
119
  - data/rushcheck/rdoc/classes/Arbitrary.src/M000075.html
120
+ - data/rushcheck/rdoc/classes/Arbitrary.src/M000076.html
119
121
  - data/rushcheck/rdoc/classes/Assertion.src/M000015.html
120
122
  - data/rushcheck/rdoc/classes/Assertion.src/M000016.html
121
123
  - data/rushcheck/rdoc/classes/Coarbitrary.src/M000095.html
124
+ - data/rushcheck/rdoc/classes/Coarbitrary.src/M000096.html
122
125
  - data/rushcheck/rdoc/classes/FalseClass.src/M000018.html
123
126
  - data/rushcheck/rdoc/classes/FalseClass.src/M000019.html
124
127
  - data/rushcheck/rdoc/classes/FalseClass.src/M000020.html
@@ -126,6 +129,7 @@ files:
126
129
  - data/rushcheck/rdoc/classes/Float.src/M000048.html
127
130
  - data/rushcheck/rdoc/classes/Float.src/M000049.html
128
131
  - data/rushcheck/rdoc/classes/Float.src/M000050.html
132
+ - data/rushcheck/rdoc/classes/Float.src/M000051.html
129
133
  - data/rushcheck/rdoc/classes/Gen.src/M000026.html
130
134
  - data/rushcheck/rdoc/classes/Gen.src/M000027.html
131
135
  - data/rushcheck/rdoc/classes/Gen.src/M000028.html
@@ -144,11 +148,13 @@ files:
144
148
  - data/rushcheck/rdoc/classes/Gen.src/M000041.html
145
149
  - data/rushcheck/rdoc/classes/Gen.src/M000042.html
146
150
  - data/rushcheck/rdoc/classes/Gen.src/M000043.html
151
+ - data/rushcheck/rdoc/classes/Gen.src/M000044.html
147
152
  - data/rushcheck/rdoc/classes/Guard.src/M000024.html
148
153
  - data/rushcheck/rdoc/classes/Guard.src/M000025.html
149
154
  - data/rushcheck/rdoc/classes/HsRandom.src/M000081.html
150
155
  - data/rushcheck/rdoc/classes/HsRandom.src/M000082.html
151
156
  - data/rushcheck/rdoc/classes/HsRandom.src/M000083.html
157
+ - data/rushcheck/rdoc/classes/HsRandom.src/M000084.html
152
158
  - data/rushcheck/rdoc/classes/Integer.src/M000006.html
153
159
  - data/rushcheck/rdoc/classes/Integer.src/M000007.html
154
160
  - data/rushcheck/rdoc/classes/Integer.src/M000008.html
@@ -156,26 +162,33 @@ files:
156
162
  - data/rushcheck/rdoc/classes/NilClass.src/M000059.html
157
163
  - data/rushcheck/rdoc/classes/NilClass.src/M000060.html
158
164
  - data/rushcheck/rdoc/classes/NilClass.src/M000061.html
165
+ - data/rushcheck/rdoc/classes/NilClass.src/M000062.html
159
166
  - data/rushcheck/rdoc/classes/Property.src/M000070.html
160
167
  - data/rushcheck/rdoc/classes/Property.src/M000071.html
168
+ - data/rushcheck/rdoc/classes/Property.src/M000072.html
161
169
  - data/rushcheck/rdoc/classes/RandomArray.src/M000021.html
162
170
  - data/rushcheck/rdoc/classes/RandomArray.src/M000022.html
163
171
  - data/rushcheck/rdoc/classes/RandomArray.src/M000023.html
164
172
  - data/rushcheck/rdoc/classes/RandomBool.src/M000079.html
165
173
  - data/rushcheck/rdoc/classes/RandomBool.src/M000080.html
174
+ - data/rushcheck/rdoc/classes/RandomBool.src/M000081.html
166
175
  - data/rushcheck/rdoc/classes/RandomGen.src/M000076.html
167
176
  - data/rushcheck/rdoc/classes/RandomGen.src/M000077.html
168
177
  - data/rushcheck/rdoc/classes/RandomGen.src/M000078.html
178
+ - data/rushcheck/rdoc/classes/RandomGen.src/M000079.html
169
179
  - data/rushcheck/rdoc/classes/RandomHash.src/M000044.html
170
180
  - data/rushcheck/rdoc/classes/RandomHash.src/M000045.html
171
181
  - data/rushcheck/rdoc/classes/RandomHash.src/M000046.html
182
+ - data/rushcheck/rdoc/classes/RandomHash.src/M000047.html
172
183
  - data/rushcheck/rdoc/classes/RandomProc.src/M000055.html
173
184
  - data/rushcheck/rdoc/classes/RandomProc.src/M000056.html
174
185
  - data/rushcheck/rdoc/classes/RandomProc.src/M000057.html
175
186
  - data/rushcheck/rdoc/classes/RandomProc.src/M000058.html
187
+ - data/rushcheck/rdoc/classes/RandomProc.src/M000059.html
176
188
  - data/rushcheck/rdoc/classes/Result.src/M000051.html
177
189
  - data/rushcheck/rdoc/classes/Result.src/M000052.html
178
190
  - data/rushcheck/rdoc/classes/Result.src/M000053.html
191
+ - data/rushcheck/rdoc/classes/Result.src/M000054.html
179
192
  - data/rushcheck/rdoc/classes/RushCheckConfig.src/M000001.html
180
193
  - data/rushcheck/rdoc/classes/RushCheckConfig.src/M000002.html
181
194
  - data/rushcheck/rdoc/classes/RushCheckConfig.src/M000003.html
@@ -191,20 +204,27 @@ files:
191
204
  - data/rushcheck/rdoc/classes/String.src/M000067.html
192
205
  - data/rushcheck/rdoc/classes/String.src/M000068.html
193
206
  - data/rushcheck/rdoc/classes/String.src/M000069.html
207
+ - data/rushcheck/rdoc/classes/String.src/M000070.html
194
208
  - data/rushcheck/rdoc/classes/Testable.src/M000084.html
195
209
  - data/rushcheck/rdoc/classes/Testable.src/M000085.html
210
+ - data/rushcheck/rdoc/classes/Testable.src/M000086.html
196
211
  - data/rushcheck/rdoc/classes/Testable.src/M000088.html
197
212
  - data/rushcheck/rdoc/classes/Testable.src/M000089.html
198
213
  - data/rushcheck/rdoc/classes/Testable.src/M000090.html
214
+ - data/rushcheck/rdoc/classes/Testable.src/M000091.html
199
215
  - data/rushcheck/rdoc/classes/Testable.src/M000092.html
216
+ - data/rushcheck/rdoc/classes/Testable.src/M000093.html
200
217
  - data/rushcheck/rdoc/classes/Testable.src/M000094.html
218
+ - data/rushcheck/rdoc/classes/Testable.src/M000095.html
201
219
  - data/rushcheck/rdoc/classes/TheStdGen.src/M000062.html
202
220
  - data/rushcheck/rdoc/classes/TheStdGen.src/M000063.html
203
221
  - data/rushcheck/rdoc/classes/TheStdGen.src/M000064.html
204
222
  - data/rushcheck/rdoc/classes/TheStdGen.src/M000065.html
223
+ - data/rushcheck/rdoc/classes/TheStdGen.src/M000066.html
205
224
  - data/rushcheck/rdoc/classes/TrueClass.src/M000072.html
206
225
  - data/rushcheck/rdoc/classes/TrueClass.src/M000073.html
207
226
  - data/rushcheck/rdoc/classes/TrueClass.src/M000074.html
227
+ - data/rushcheck/rdoc/classes/TrueClass.src/M000075.html
208
228
  - data/rushcheck/rdoc/files/rushcheck
209
229
  - data/rushcheck/rdoc/files/rushcheck/arbitrary_rb.html
210
230
  - data/rushcheck/rdoc/files/rushcheck/array_rb.html