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
|
<?xml version="1.0" encoding="ascii" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ascii" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
<title>Regression Testing for javadoc</title>
<link rel="stylesheet" href="../custom.css" type="text/css" />
</head>
<body>
<div class="document" id="regression-testing-for-javadoc">
<h1 class="title">Regression Testing for javadoc</h1>
<blockquote>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> epydoc.test.util <span class="py-keyword">import</span> print_warnings
<span class="py-prompt">>>> </span>print_warnings()</pre>
</blockquote>
<div class="section" id="summary">
<h1>Summary</h1>
<p>The implementation of the summaization function works as expected.</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span><span class="py-keyword">from</span> epydoc.markup <span class="py-keyword">import</span> javadoc
<span class="py-prompt">>>> </span><span class="py-keyword">def</span> <span class="py-defname">getsummary</span>(s):
<span class="py-more">... </span> p = javadoc.parse_docstring(s, [])
<span class="py-more">... </span> s, o = p.summary()
<span class="py-more">... </span> s = s.to_plaintext(None).strip()
<span class="py-more">... </span> return s, o</pre>
<p>#Let's not lose anything!</p>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"Single line"</span>)
<span class="py-output">('Single line', False)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"Single line."</span>)
<span class="py-output">('Single line.', False)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Single line <i>with</i> period.</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Single line <i>with</i> period.', False)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Single line <i>with</i> period.</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">@type Also with a tag.</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Single line <i>with</i> period.', False)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Other lines <i>with</i> period.</span>
<span class="py-more">... </span><span class="py-string">This is attached</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Other lines <i>with</i> period.', True)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Other lines <i>with</i> period.</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">This is detached</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">@type Also with a tag.</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Other lines <i>with</i> period.', True)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Other lines without period</span>
<span class="py-more">... </span><span class="py-string">This is attached</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Other lines without period...', True)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Other lines without period</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">This is detached</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Other lines without period...', True)</span></pre>
<pre class="py-doctest">
<span class="py-prompt">>>> </span>getsummary(<span class="py-string">"""</span>
<span class="py-more">... </span><span class="py-string">Single line <i>without</i> period</span>
<span class="py-more">...</span>
<span class="py-more">... </span><span class="py-string">@type Also with a tag.</span>
<span class="py-more">... </span><span class="py-string">"""</span>)
<span class="py-output">('Single line <i>without</i> period', False)</span></pre>
</div>
</div>
<table width="100%" class="navbox" cellpadding="1" cellspacing="0">
<tr>
<a class="nav" href="../index.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="../index.html">
Home</a></td></a>
<a class="nav" href="../installing.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="../installing.html">
Installing Epydoc</a></td></a>
<a class="nav" href="../using.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="../using.html">
Using Epydoc</a></td></a>
<a class="nav" href="../epytext.html">
<td align="center" width="20%" class="nav">
<a class="nav" href="../epytext.html">
Epytext</a></td></a>
<td align="center" width="20%" class="nav">
<A href="http://sourceforge.net/projects/epydoc">
<IMG src="../sflogo.png"
width="88" height="26" border="0" alt="SourceForge"
align="top"/></A></td>
</tr>
</table>
</body>
</html>
|