1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
"Hello"
"Hello"
badCase
CallStack (from ImplicitParams):
error, called at subdir/tough2.lhs:40:14 in main:Main
badCase
CallStack (from ImplicitParams):
error, called at subdir/tough2.lhs:40:14 in main:Main
"Bark"
"Hello"
(1,2,3)
71% expressions used (68/95)
14% boolean coverage (1/7)
0% guards (0/4), 3 always True, 1 always False
33% 'if' conditions (1/3), 1 always True, 1 always False
100% qualifiers (0/0)
58% alternatives used (7/12)
100% local declarations used (0/0)
83% top-level declarations used (5/6)
-----<module Main>-----
71% expressions used (68/95)
14% boolean coverage (1/7)
0% guards (0/4), 3 always True, 1 always False
33% 'if' conditions (1/3), 1 always True, 1 always False
100% qualifiers (0/0)
58% alternatives used (7/12)
100% local declarations used (0/0)
83% top-level declarations used (5/6)
Writing: Main.hs.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
span.lineno { color: white; background: #aaaaaa; border-right: solid white 12px }
span.nottickedoff { background: yellow}
span.istickedoff { background: white }
span.tickonlyfalse { margin: -1px; border: 1px solid #f20913; background: #f20913 }
span.tickonlytrue { margin: -1px; border: 1px solid #60de51; background: #60de51 }
span.funcount { font-size: small; color: orange; z-index: 2; position: absolute; right: 20 }
span.decl { font-weight: bold }
span.spaces { background: white }
</style>
</head>
<body>
<pre>
<span class="lineno"> 1 </span>\begin{code}
<span class="lineno"> 2 </span>import Control.Exception as E
<span class="lineno"> 3 </span>
<span class="lineno"> 4 </span>-- This test shows what hpc can really do.
<span class="lineno"> 5 </span>
<span class="lineno"> 6 </span><span class="decl"><span class="istickedoff">main = do</span>
<span class="lineno"> 7 </span><span class="spaces"> </span><span class="istickedoff">print ("Hello")</span>
<span class="lineno"> 8 </span><span class="spaces"> </span><span class="istickedoff">foo "Hello"</span>
<span class="lineno"> 9 </span><span class="spaces"> </span><span class="istickedoff">E.catch (print (badCase 22 <span class="nottickedoff">44</span>))</span>
<span class="lineno"> 10 </span><span class="spaces"> </span><span class="istickedoff">(\ e -> print (e :: E.ErrorCall))</span>
<span class="lineno"> 11 </span><span class="spaces"> </span><span class="istickedoff">E.catch (print (badCase 22 <span class="nottickedoff">(error "Foo")</span>))</span>
<span class="lineno"> 12 </span><span class="spaces"> </span><span class="istickedoff">(\ e -> print (e :: E.ErrorCall))</span>
<span class="lineno"> 13 </span><span class="spaces"> </span><span class="istickedoff">E.catch (print "Bark")</span>
<span class="lineno"> 14 </span><span class="spaces"> </span><span class="istickedoff"><span class="nottickedoff">(\ e -> print (e :: E.ErrorCall))</span></span>
<span class="lineno"> 15 </span><span class="spaces"> </span><span class="istickedoff">(_,_) <- return $ (<span class="nottickedoff">"Hello"</span>,<span class="nottickedoff">"World"</span>)</span>
<span class="lineno"> 16 </span><span class="spaces"> </span><span class="istickedoff">return <span class="nottickedoff">()</span></span>
<span class="lineno"> 17 </span><span class="spaces"> </span><span class="istickedoff">() <- return ()</span>
<span class="lineno"> 18 </span><span class="spaces"> </span><span class="istickedoff">t <- case <span class="nottickedoff">()</span> of</span>
<span class="lineno"> 19 </span><span class="spaces"> </span><span class="istickedoff">_ | <span class="tickonlytrue">otherwoz</span> -> return <span class="nottickedoff">"Hello"</span></span>
<span class="lineno"> 20 </span><span class="spaces"> </span><span class="istickedoff">_ -> <span class="nottickedoff">error "Bad Thing Happened"</span></span>
<span class="lineno"> 21 </span><span class="spaces"> </span><span class="istickedoff">t <- case <span class="nottickedoff">()</span> of</span>
<span class="lineno"> 22 </span><span class="spaces"> </span><span class="istickedoff">_ | <span class="tickonlytrue">otherwise</span> -> return <span class="nottickedoff">"Hello"</span></span>
<span class="lineno"> 23 </span><span class="spaces"> </span><span class="istickedoff">_ -> <span class="nottickedoff">error "Bad Thing Happened"</span></span>
<span class="lineno"> 24 </span><span class="spaces"> </span><span class="istickedoff">t <- case <span class="nottickedoff">()</span> of</span>
<span class="lineno"> 25 </span><span class="spaces"> </span><span class="istickedoff">_ | <span class="tickonlytrue">otherwise</span> </span>
<span class="lineno"> 26 </span><span class="spaces"> </span><span class="istickedoff">, <span class="tickonlyfalse">False</span> -> <span class="nottickedoff">error "Bad Thing Happened"</span></span>
<span class="lineno"> 27 </span><span class="spaces"> </span><span class="istickedoff">_ -> return "Hello"</span>
<span class="lineno"> 28 </span><span class="spaces"> </span><span class="istickedoff">print t</span>
<span class="lineno"> 29 </span><span class="spaces"> </span><span class="istickedoff">print foo2</span></span>
<span class="lineno"> 30 </span>
<span class="lineno"> 31 </span><span class="decl"><span class="istickedoff">foo x = do</span>
<span class="lineno"> 32 </span><span class="spaces"> </span><span class="istickedoff">print x</span>
<span class="lineno"> 33 </span><span class="spaces"> </span><span class="istickedoff">return <span class="nottickedoff">()</span></span></span>
<span class="lineno"> 34 </span>
<span class="lineno"> 35 </span><span class="decl"><span class="nottickedoff">unused_ a = a</span></span>
<span class="lineno"> 36 </span>
<span class="lineno"> 37 </span>badCase :: Int -> Int -> Int
<span class="lineno"> 38 </span><span class="decl"><span class="istickedoff">badCase a b = </span>
<span class="lineno"> 39 </span><span class="spaces"> </span><span class="istickedoff">if a > 100 </span>
<span class="lineno"> 40 </span><span class="spaces"> </span><span class="istickedoff">then error "badCase" </span>
<span class="lineno"> 41 </span><span class="spaces"> </span><span class="istickedoff">else if <span class="tickonlyfalse">a > 1000</span> </span>
<span class="lineno"> 42 </span><span class="spaces"> </span><span class="istickedoff">then <span class="nottickedoff">1</span> </span>
<span class="lineno"> 43 </span><span class="spaces"> </span><span class="istickedoff">else badCase (a + 1) <span class="nottickedoff">(b - 1)</span></span></span>
<span class="lineno"> 44 </span>
<span class="lineno"> 45 </span>
<span class="lineno"> 46 </span><span class="decl"><span class="istickedoff">foo2 = (1,2, if <span class="tickonlytrue">True</span> then 3 else <span class="nottickedoff">4</span>)</span></span>
<span class="lineno"> 47 </span>
<span class="lineno"> 48 </span><span class="decl"><span class="istickedoff">otherwoz = True</span></span>
<span class="lineno"> 49 </span>\end{code}
</pre>
</body>
</html>
Writing: hpc_index.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.bar { background-color: #f25913; }
td.bar { background-color: #60de51; }
td.invbar { background-color: #f25913; }
table.dashboard { border-collapse: collapse ; border: solid 1px black }
.dashboard td { border: solid 1px black }
.dashboard th { border: solid 1px black }
</style>
</head><body><table class="dashboard" width="100%" border=1>
<tr><th rowspan=2><a href="hpc_index.html">module</a></th><th colspan=3><a href="hpc_index_fun.html">Top Level Definitions</a></th><th colspan=3><a href="hpc_index_alt.html">Alternatives</a></th><th colspan=3><a href="hpc_index_exp.html">Expressions</a></th></tr><tr><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th></tr><tr>
<td> <tt>module <a href="Main.hs.html">Main</a></tt></td>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
<tr></tr><tr style="background: #e0e0e0">
<th align=left> Program Coverage Total</tt></th>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
</table></body></html>
Writing: hpc_index_fun.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.bar { background-color: #f25913; }
td.bar { background-color: #60de51; }
td.invbar { background-color: #f25913; }
table.dashboard { border-collapse: collapse ; border: solid 1px black }
.dashboard td { border: solid 1px black }
.dashboard th { border: solid 1px black }
</style>
</head><body><table class="dashboard" width="100%" border=1>
<tr><th rowspan=2><a href="hpc_index.html">module</a></th><th colspan=3><a href="hpc_index_fun.html">Top Level Definitions</a></th><th colspan=3><a href="hpc_index_alt.html">Alternatives</a></th><th colspan=3><a href="hpc_index_exp.html">Expressions</a></th></tr><tr><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th></tr><tr>
<td> <tt>module <a href="Main.hs.html">Main</a></tt></td>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
<tr></tr><tr style="background: #e0e0e0">
<th align=left> Program Coverage Total</tt></th>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
</table></body></html>
Writing: hpc_index_alt.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.bar { background-color: #f25913; }
td.bar { background-color: #60de51; }
td.invbar { background-color: #f25913; }
table.dashboard { border-collapse: collapse ; border: solid 1px black }
.dashboard td { border: solid 1px black }
.dashboard th { border: solid 1px black }
</style>
</head><body><table class="dashboard" width="100%" border=1>
<tr><th rowspan=2><a href="hpc_index.html">module</a></th><th colspan=3><a href="hpc_index_fun.html">Top Level Definitions</a></th><th colspan=3><a href="hpc_index_alt.html">Alternatives</a></th><th colspan=3><a href="hpc_index_exp.html">Expressions</a></th></tr><tr><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th></tr><tr>
<td> <tt>module <a href="Main.hs.html">Main</a></tt></td>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
<tr></tr><tr style="background: #e0e0e0">
<th align=left> Program Coverage Total</tt></th>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
</table></body></html>
Writing: hpc_index_exp.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.bar { background-color: #f25913; }
td.bar { background-color: #60de51; }
td.invbar { background-color: #f25913; }
table.dashboard { border-collapse: collapse ; border: solid 1px black }
.dashboard td { border: solid 1px black }
.dashboard th { border: solid 1px black }
</style>
</head><body><table class="dashboard" width="100%" border=1>
<tr><th rowspan=2><a href="hpc_index.html">module</a></th><th colspan=3><a href="hpc_index_fun.html">Top Level Definitions</a></th><th colspan=3><a href="hpc_index_alt.html">Alternatives</a></th><th colspan=3><a href="hpc_index_exp.html">Expressions</a></th></tr><tr><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th><th>%</th><th colspan=2>covered / total</th></tr><tr>
<td> <tt>module <a href="Main.hs.html">Main</a></tt></td>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
<tr></tr><tr style="background: #e0e0e0">
<th align=left> Program Coverage Total</tt></th>
<td align="right">83%</td><td>5/6</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="83%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">58%</td><td>7/12</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="58%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td><td align="right">71%</td><td>68/95</td><td width=100><table cellpadding=0 cellspacing=0 width="100" class="bar"><tr><td><table cellpadding=0 cellspacing=0 width="71%"><tr><td height=12 class="bar"></td></tr></table></td></tr></table></td></tr>
</table></body></html>
|