rushcheck 0.3 → 0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +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,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>set_pattern (RandomProc)</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/proc.rb, line 15</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set_pattern</span>(<span class="ruby-identifier">inputs</span>, <span class="ruby-identifier">outputs</span>)
|
|
15
|
+
<span class="ruby-ivar">@@inputs</span>, <span class="ruby-ivar">@@outputs</span> = <span class="ruby-identifier">inputs</span>, <span class="ruby-identifier">outputs</span>
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>arbitrary (RandomProc)</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/proc.rb, line 19</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">arbitrary</span>
|
|
15
|
+
<span class="ruby-constant">Gen</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
|
16
|
+
<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
|
17
|
+
<span class="ruby-identifier">gens</span> = <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
|
|
18
|
+
<span class="ruby-keyword kw">then</span> <span class="ruby-ivar">@@outputs</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">arbitrary</span> }
|
|
19
|
+
<span class="ruby-keyword kw">else</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
|
20
|
+
<span class="ruby-ivar">@@outputs</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
21
|
+
<span class="ruby-identifier">v</span>.<span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">c</span>.<span class="ruby-identifier">arbitrary</span>)
|
|
22
|
+
<span class="ruby-keyword kw">end</span>
|
|
23
|
+
<span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">flatten</span>
|
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
|
25
|
+
<span class="ruby-constant">Gen</span>.<span class="ruby-identifier">oneof</span>(<span class="ruby-identifier">gens</span>).<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span>)
|
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
|
27
|
+
<span class="ruby-keyword kw">end</span>
|
|
28
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
29
|
+
</body>
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>coarbitrary (RandomProc)</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/proc.rb, line 35</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-constant">Gen</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
|
|
16
|
+
<span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r</span>
|
|
17
|
+
<span class="ruby-identifier">args</span> = <span class="ruby-ivar">@@inputs</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
|
18
|
+
<span class="ruby-identifier">r1</span>, <span class="ruby-identifier">r2</span> = <span class="ruby-identifier">r2</span>.<span class="ruby-identifier">split</span>
|
|
19
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">arbitrary</span>.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">r1</span>)
|
|
20
|
+
<span class="ruby-keyword kw">end</span>
|
|
21
|
+
|
|
22
|
+
<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>).<span class="ruby-identifier">coarbitrary</span>(<span class="ruby-identifier">g</span>)
|
|
23
|
+
<span class="ruby-keyword kw">end</span>
|
|
24
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>property (RandomProc)</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/proc.rb, line 47</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">property</span>
|
|
15
|
+
<span class="ruby-constant">Gen</span>.<span class="ruby-identifier">lift_array</span>(<span class="ruby-ivar">@@inputs</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">arbitrary</span> }.<span class="ruby-identifier">forall</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
|
16
|
+
<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
|
17
|
+
<span class="ruby-keyword kw">end</span>
|
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
89
|
+
<a href="#M000057">new</a>
|
|
90
|
+
<a href="#M000056">nothing</a>
|
|
91
|
+
<a href="#M000059">property</a>
|
|
92
|
+
<a href="#M000058">result</a>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -141,12 +141,12 @@
|
|
|
141
141
|
<div id="methods">
|
|
142
142
|
<h3 class="section-bar">Public Class methods</h3>
|
|
143
143
|
|
|
144
|
-
<div id="method-
|
|
145
|
-
<a name="
|
|
144
|
+
<div id="method-M000057" class="method-detail">
|
|
145
|
+
<a name="M000057"></a>
|
|
146
146
|
|
|
147
147
|
<div class="method-heading">
|
|
148
|
-
<a href="Result.src/
|
|
149
|
-
onclick="popupCode('Result.src/
|
|
148
|
+
<a href="Result.src/M000057.html" target="Code" class="method-signature"
|
|
149
|
+
onclick="popupCode('Result.src/M000057.html');return false;">
|
|
150
150
|
<span class="method-name">new</span><span class="method-args">(ok=nil, stamp=[], arguments=[])</span>
|
|
151
151
|
</a>
|
|
152
152
|
</div>
|
|
@@ -155,12 +155,12 @@
|
|
|
155
155
|
</div>
|
|
156
156
|
</div>
|
|
157
157
|
|
|
158
|
-
<div id="method-
|
|
159
|
-
<a name="
|
|
158
|
+
<div id="method-M000056" class="method-detail">
|
|
159
|
+
<a name="M000056"></a>
|
|
160
160
|
|
|
161
161
|
<div class="method-heading">
|
|
162
|
-
<a href="Result.src/
|
|
163
|
-
onclick="popupCode('Result.src/
|
|
162
|
+
<a href="Result.src/M000056.html" target="Code" class="method-signature"
|
|
163
|
+
onclick="popupCode('Result.src/M000056.html');return false;">
|
|
164
164
|
<span class="method-name">nothing</span><span class="method-args">()</span>
|
|
165
165
|
</a>
|
|
166
166
|
</div>
|
|
@@ -171,8 +171,8 @@
|
|
|
171
171
|
|
|
172
172
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
173
173
|
|
|
174
|
-
<div id="method-
|
|
175
|
-
<a name="
|
|
174
|
+
<div id="method-M000059" class="method-detail">
|
|
175
|
+
<a name="M000059"></a>
|
|
176
176
|
|
|
177
177
|
<div class="method-heading">
|
|
178
178
|
<span class="method-name">property</span><span class="method-args">()</span>
|
|
@@ -180,17 +180,17 @@
|
|
|
180
180
|
|
|
181
181
|
<div class="method-description">
|
|
182
182
|
<p>
|
|
183
|
-
Alias for <a href="Result.html#
|
|
183
|
+
Alias for <a href="Result.html#M000058">result</a>
|
|
184
184
|
</p>
|
|
185
185
|
</div>
|
|
186
186
|
</div>
|
|
187
187
|
|
|
188
|
-
<div id="method-
|
|
189
|
-
<a name="
|
|
188
|
+
<div id="method-M000058" class="method-detail">
|
|
189
|
+
<a name="M000058"></a>
|
|
190
190
|
|
|
191
191
|
<div class="method-heading">
|
|
192
|
-
<a href="Result.src/
|
|
193
|
-
onclick="popupCode('Result.src/
|
|
192
|
+
<a href="Result.src/M000058.html" target="Code" class="method-signature"
|
|
193
|
+
onclick="popupCode('Result.src/M000058.html');return false;">
|
|
194
194
|
<span class="method-name">result</span><span class="method-args">()</span>
|
|
195
195
|
</a>
|
|
196
196
|
</div>
|
|
@@ -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>nothing (Result)</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/result.rb, line 12</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">nothing</span>
|
|
15
|
+
<span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">false</span>)
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
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>new (Result)</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/result.rb, line 17</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ok</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">stamp</span>=[], <span class="ruby-identifier">arguments</span>=[])
|
|
15
|
+
<span class="ruby-ivar">@ok</span>, <span class="ruby-ivar">@stamp</span>, <span class="ruby-ivar">@arguments</span> = <span class="ruby-identifier">ok</span>, <span class="ruby-identifier">stamp</span>, <span class="ruby-identifier">arguments</span>
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
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>result (Result)</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/result.rb, line 21</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result</span>
|
|
15
|
+
<span class="ruby-constant">Property</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ok</span>, <span class="ruby-ivar">@stamp</span>, <span class="ruby-ivar">@arguments</span>)
|
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -93,10 +93,12 @@ configurations of tests. This class is needed for several test functions.
|
|
|
93
93
|
<h3 class="section-bar">Methods</h3>
|
|
94
94
|
|
|
95
95
|
<div class="name-list">
|
|
96
|
-
<a href="#
|
|
97
|
-
<a href="#
|
|
96
|
+
<a href="#M000003">batch</a>
|
|
97
|
+
<a href="#M000005">done</a>
|
|
98
|
+
<a href="#M000004">new</a>
|
|
98
99
|
<a href="#M000001">quick</a>
|
|
99
|
-
<a href="#
|
|
100
|
+
<a href="#M000007">test_batch</a>
|
|
101
|
+
<a href="#M000006">tests</a>
|
|
100
102
|
<a href="#M000002">verbose</a>
|
|
101
103
|
</div>
|
|
102
104
|
</div>
|
|
@@ -153,6 +155,20 @@ configurations of tests. This class is needed for several test functions.
|
|
|
153
155
|
<div class="method-heading">
|
|
154
156
|
<a href="RushCheckConfig.src/M000003.html" target="Code" class="method-signature"
|
|
155
157
|
onclick="popupCode('RushCheckConfig.src/M000003.html');return false;">
|
|
158
|
+
<span class="method-name">batch</span><span class="method-args">(n, v)</span>
|
|
159
|
+
</a>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="method-description">
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
<div id="method-M000004" class="method-detail">
|
|
167
|
+
<a name="M000004"></a>
|
|
168
|
+
|
|
169
|
+
<div class="method-heading">
|
|
170
|
+
<a href="RushCheckConfig.src/M000004.html" target="Code" class="method-signature"
|
|
171
|
+
onclick="popupCode('RushCheckConfig.src/M000004.html');return false;">
|
|
156
172
|
<span class="method-name">new</span><span class="method-args">(max_test, max_fail, size, every)</span>
|
|
157
173
|
</a>
|
|
158
174
|
</div>
|
|
@@ -191,12 +207,12 @@ configurations of tests. This class is needed for several test functions.
|
|
|
191
207
|
|
|
192
208
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
193
209
|
|
|
194
|
-
<div id="method-
|
|
195
|
-
<a name="
|
|
210
|
+
<div id="method-M000005" class="method-detail">
|
|
211
|
+
<a name="M000005"></a>
|
|
196
212
|
|
|
197
213
|
<div class="method-heading">
|
|
198
|
-
<a href="RushCheckConfig.src/
|
|
199
|
-
onclick="popupCode('RushCheckConfig.src/
|
|
214
|
+
<a href="RushCheckConfig.src/M000005.html" target="Code" class="method-signature"
|
|
215
|
+
onclick="popupCode('RushCheckConfig.src/M000005.html');return false;">
|
|
200
216
|
<span class="method-name">done</span><span class="method-args">(mesg, ntest, stamps)</span>
|
|
201
217
|
</a>
|
|
202
218
|
</div>
|
|
@@ -208,12 +224,26 @@ print results of tests.
|
|
|
208
224
|
</div>
|
|
209
225
|
</div>
|
|
210
226
|
|
|
211
|
-
<div id="method-
|
|
212
|
-
<a name="
|
|
227
|
+
<div id="method-M000007" class="method-detail">
|
|
228
|
+
<a name="M000007"></a>
|
|
213
229
|
|
|
214
230
|
<div class="method-heading">
|
|
215
|
-
<a href="RushCheckConfig.src/
|
|
216
|
-
onclick="popupCode('RushCheckConfig.src/
|
|
231
|
+
<a href="RushCheckConfig.src/M000007.html" target="Code" class="method-signature"
|
|
232
|
+
onclick="popupCode('RushCheckConfig.src/M000007.html');return false;">
|
|
233
|
+
<span class="method-name">test_batch</span><span class="method-args">(gen, rnd, nt=1, nf=0, stamps=[])</span>
|
|
234
|
+
</a>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div class="method-description">
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
<div id="method-M000006" class="method-detail">
|
|
242
|
+
<a name="M000006"></a>
|
|
243
|
+
|
|
244
|
+
<div class="method-heading">
|
|
245
|
+
<a href="RushCheckConfig.src/M000006.html" target="Code" class="method-signature"
|
|
246
|
+
onclick="popupCode('RushCheckConfig.src/M000006.html');return false;">
|
|
217
247
|
<span class="method-name">tests</span><span class="method-args">(gen, rnd, nt=1, nf=0, stamps=[])</span>
|
|
218
248
|
</a>
|
|
219
249
|
</div>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line 12</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">quick</span>
|
|
15
15
|
<span class="ruby-identifier">new</span>(<span class="ruby-value">100</span>, <span class="ruby-value">1000</span>,
|
|
16
16
|
<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line 21</span>
|
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">verbose</span>
|
|
15
15
|
<span class="ruby-identifier">new</span>(<span class="ruby-value">100</span>, <span class="ruby-value">1000</span>,
|
|
16
16
|
<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>},
|
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>batch (RushCheckConfig)</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/config.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-
|
|
15
|
-
<span class="ruby-
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line 29</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">batch</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">v</span>)
|
|
15
|
+
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">n</span>, <span class="ruby-identifier">n</span> <span class="ruby-operator">*</span> <span class="ruby-value">10</span>,
|
|
16
|
+
<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">x</span> <span class="ruby-operator">/</span> <span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>).<span class="ruby-identifier">to_i</span>},
|
|
17
|
+
<span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>, <span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
|
|
18
|
+
<span class="ruby-identifier">v</span> <span class="ruby-value">? </span><span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">":\n"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">"\n"</span> <span class="ruby-operator">:</span> <span class="ruby-value str">""</span>
|
|
19
|
+
<span class="ruby-keyword kw">end</span>)
|
|
16
20
|
<span class="ruby-keyword kw">end</span></pre>
|
|
17
21
|
</body>
|
|
18
22
|
</html>
|
|
@@ -5,34 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (RushCheckConfig)</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/config.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-
|
|
16
|
-
|
|
17
|
-
<span class="ruby-identifier">bag</span> = <span class="ruby-identifier">stamps</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">find_all</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">empty?</span>}.<span class="ruby-identifier">sort</span>.
|
|
18
|
-
<span class="ruby-identifier">inject</span>(<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span>, <span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
|
19
|
-
<span class="ruby-identifier">r</span>[<span class="ruby-identifier">m</span>] = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">m</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">m</span>] <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
20
|
-
<span class="ruby-identifier">r</span>
|
|
21
|
-
<span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>}.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pair</span><span class="ruby-operator">|</span>
|
|
22
|
-
<span class="ruby-identifier">percentage</span> = ((<span class="ruby-value">100</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">pair</span>[<span class="ruby-value">1</span>]) <span class="ruby-operator">/</span> <span class="ruby-identifier">ntest</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'%'</span>
|
|
23
|
-
([<span class="ruby-identifier">percentage</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">pair</span>[<span class="ruby-value">0</span>]).<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
|
24
|
-
<span class="ruby-keyword kw">end</span>
|
|
25
|
-
|
|
26
|
-
<span class="ruby-identifier">mes</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">bag</span>.<span class="ruby-identifier">length</span>
|
|
27
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
|
28
|
-
<span class="ruby-value str">".\n"</span>
|
|
29
|
-
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
|
30
|
-
<span class="ruby-value str">'('</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bag</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">").\n"</span>
|
|
31
|
-
<span class="ruby-keyword kw">else</span>
|
|
32
|
-
<span class="ruby-value str">".\n"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bag</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">".\n"</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">".\n"</span>
|
|
33
|
-
<span class="ruby-keyword kw">end</span>
|
|
34
|
-
|
|
35
|
-
<span class="ruby-identifier">print</span> <span class="ruby-identifier">mes</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line 37</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">max_test</span>, <span class="ruby-identifier">max_fail</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">every</span>)
|
|
15
|
+
<span class="ruby-ivar">@max_test</span>, <span class="ruby-ivar">@max_fail</span>, <span class="ruby-ivar">@size</span>, <span class="ruby-ivar">@every</span> = <span class="ruby-identifier">max_test</span>, <span class="ruby-identifier">max_fail</span>, <span class="ruby-identifier">size</span>, <span class="ruby-identifier">every</span>
|
|
36
16
|
<span class="ruby-keyword kw">end</span></pre>
|
|
37
17
|
</body>
|
|
38
18
|
</html>
|
|
@@ -5,51 +5,34 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>done (RushCheckConfig)</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/config.rb, line
|
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
|
15
|
-
<span class="ruby-identifier">
|
|
16
|
-
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
|
17
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ntest</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_test</span>
|
|
18
|
-
<span class="ruby-identifier">done</span>(<span class="ruby-value str">'OK, passed'</span>, <span class="ruby-identifier">max_test</span>, <span class="ruby-identifier">stamps</span>)
|
|
19
|
-
<span class="ruby-identifier">tests_result</span> = <span class="ruby-keyword kw">true</span>
|
|
20
|
-
<span class="ruby-keyword kw">break</span>
|
|
21
|
-
<span class="ruby-keyword kw">end</span>
|
|
22
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nfail</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_fail</span>
|
|
23
|
-
<span class="ruby-identifier">done</span>(<span class="ruby-value str">'Arguments exhausted after '</span>, <span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">stamps</span>)
|
|
24
|
-
<span class="ruby-identifier">tests_result</span> = <span class="ruby-keyword kw">nil</span>
|
|
25
|
-
<span class="ruby-keyword kw">break</span>
|
|
26
|
-
<span class="ruby-keyword kw">end</span>
|
|
13
|
+
<pre><span class="ruby-comment cmt"># File rushcheck/config.rb, line 42</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">done</span>(<span class="ruby-identifier">mesg</span>, <span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">stamps</span>)
|
|
15
|
+
<span class="ruby-identifier">print</span> <span class="ruby-identifier">mesg</span> <span class="ruby-operator">+</span> <span class="ruby-value str">' '</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ntest</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">' tests'</span>
|
|
27
16
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
<span class="ruby-identifier">bag</span> = <span class="ruby-identifier">stamps</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">find_all</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">empty?</span>}.<span class="ruby-identifier">sort</span>.
|
|
18
|
+
<span class="ruby-identifier">inject</span>(<span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span>, <span class="ruby-identifier">m</span><span class="ruby-operator">|</span>
|
|
19
|
+
<span class="ruby-identifier">r</span>[<span class="ruby-identifier">m</span>] = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">m</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">m</span>] <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
20
|
+
<span class="ruby-identifier">r</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>}.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pair</span><span class="ruby-operator">|</span>
|
|
22
|
+
<span class="ruby-identifier">percentage</span> = ((<span class="ruby-value">100</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">pair</span>[<span class="ruby-value">1</span>]) <span class="ruby-operator">/</span> <span class="ruby-identifier">ntest</span>).<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'%'</span>
|
|
23
|
+
([<span class="ruby-identifier">percentage</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">pair</span>[<span class="ruby-value">0</span>]).<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>)
|
|
24
|
+
<span class="ruby-keyword kw">end</span>
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>)
|
|
44
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">error</span>
|
|
45
|
-
<span class="ruby-identifier">tests_result</span> = <span class="ruby-keyword kw">false</span>
|
|
46
|
-
<span class="ruby-keyword kw">break</span>
|
|
47
|
-
<span class="ruby-keyword kw">else</span>
|
|
48
|
-
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">"RushCheck: illegal result"</span>)
|
|
49
|
-
<span class="ruby-keyword kw">end</span>
|
|
50
|
-
<span class="ruby-keyword kw">end</span>
|
|
51
|
-
|
|
52
|
-
<span class="ruby-identifier">tests_result</span>
|
|
26
|
+
<span class="ruby-identifier">mes</span> = <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">bag</span>.<span class="ruby-identifier">length</span>
|
|
27
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span>
|
|
28
|
+
<span class="ruby-value str">".\n"</span>
|
|
29
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
|
|
30
|
+
<span class="ruby-value str">'('</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bag</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">").\n"</span>
|
|
31
|
+
<span class="ruby-keyword kw">else</span>
|
|
32
|
+
<span class="ruby-value str">".\n"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">bag</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">".\n"</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">".\n"</span>
|
|
33
|
+
<span class="ruby-keyword kw">end</span>
|
|
34
|
+
|
|
35
|
+
<span class="ruby-identifier">print</span> <span class="ruby-identifier">mes</span>
|
|
53
36
|
<span class="ruby-keyword kw">end</span></pre>
|
|
54
37
|
</body>
|
|
55
38
|
</html>
|
|
@@ -0,0 +1,55 @@
|
|
|
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>tests (RushCheckConfig)</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/config.rb, line 67</span>
|
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tests</span>(<span class="ruby-identifier">gen</span>, <span class="ruby-identifier">rnd</span>, <span class="ruby-identifier">nt</span>=<span class="ruby-value">1</span>, <span class="ruby-identifier">nf</span>=<span class="ruby-value">0</span>, <span class="ruby-identifier">stamps</span>=[])
|
|
15
|
+
<span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">nfail</span> = <span class="ruby-identifier">nt</span>, <span class="ruby-identifier">nf</span>
|
|
16
|
+
<span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
|
|
17
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ntest</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_test</span>
|
|
18
|
+
<span class="ruby-identifier">done</span>(<span class="ruby-value str">'OK, passed'</span>, <span class="ruby-identifier">max_test</span>, <span class="ruby-identifier">stamps</span>)
|
|
19
|
+
<span class="ruby-identifier">tests_result</span> = <span class="ruby-keyword kw">true</span>
|
|
20
|
+
<span class="ruby-keyword kw">break</span>
|
|
21
|
+
<span class="ruby-keyword kw">end</span>
|
|
22
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nfail</span> <span class="ruby-operator">></span> <span class="ruby-identifier">max_fail</span>
|
|
23
|
+
<span class="ruby-identifier">done</span>(<span class="ruby-value str">'Arguments exhausted after '</span>, <span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">stamps</span>)
|
|
24
|
+
<span class="ruby-identifier">tests_result</span> = <span class="ruby-keyword kw">nil</span>
|
|
25
|
+
<span class="ruby-keyword kw">break</span>
|
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
|
27
|
+
|
|
28
|
+
<span class="ruby-identifier">rnd_l</span>, <span class="ruby-identifier">rnd_r</span> = <span class="ruby-identifier">rnd</span>.<span class="ruby-identifier">split</span>
|
|
29
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">gen</span>.<span class="ruby-identifier">generate</span>(<span class="ruby-identifier">size</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">ntest</span>), <span class="ruby-identifier">rnd_r</span>)
|
|
30
|
+
<span class="ruby-identifier">message</span> = <span class="ruby-identifier">every</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">ntest</span>, <span class="ruby-identifier">result</span>.<span class="ruby-identifier">arguments</span>)
|
|
31
|
+
<span class="ruby-identifier">print</span> <span class="ruby-identifier">message</span> <span class="ruby-comment cmt"># don't puts</span>
|
|
32
|
+
|
|
33
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">ok</span>
|
|
34
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
|
|
35
|
+
<span class="ruby-identifier">nfail</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
36
|
+
<span class="ruby-keyword kw">redo</span>
|
|
37
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">true</span>
|
|
38
|
+
<span class="ruby-identifier">stamps</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">stamp</span>)
|
|
39
|
+
<span class="ruby-identifier">ntest</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
40
|
+
<span class="ruby-keyword kw">redo</span>
|
|
41
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">false</span>
|
|
42
|
+
<span class="ruby-identifier">error</span> = <span class="ruby-value str">"Falsifiable, after "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">ntest</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-value str">" tests:\n"</span> <span class="ruby-operator">+</span>
|
|
43
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>)
|
|
44
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">error</span>
|
|
45
|
+
<span class="ruby-identifier">tests_result</span> = <span class="ruby-keyword kw">false</span>
|
|
46
|
+
<span class="ruby-keyword kw">break</span>
|
|
47
|
+
<span class="ruby-keyword kw">else</span>
|
|
48
|
+
<span class="ruby-identifier">raise</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-value str">"RushCheck: illegal result"</span>)
|
|
49
|
+
<span class="ruby-keyword kw">end</span>
|
|
50
|
+
<span class="ruby-keyword kw">end</span>
|
|
51
|
+
|
|
52
|
+
<span class="ruby-identifier">tests_result</span>
|
|
53
|
+
<span class="ruby-keyword kw">end</span></pre>
|
|
54
|
+
</body>
|
|
55
|
+
</html>
|