Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.7.1
-
Component/s: groovy-jdk
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Added groovy assertions to Javadocs for Collection methods, e.g.:
/**
* Sums the items in a collection. This is equivalent to invoking the
* "plus" method on all items in the collection.
* <pre class="groovyTestCase">assert 1+2+3+4 == [1,2,3,4].sum()</pre>
*
* @param self Collection of values to add together
* @return The sum of all of the items
* @since 1.0
*/
The patch includes a TestSuite that will execute the code inside the pre tag to ensure that the assertions hold.
Attachments
Issue Links
| This issue supercedes: | ||||
| GROOVY-3913 | Automated testing of Groovy assertions in javadoc comments |
|
|
|
If this could benefit from being part of the Groovy distribution then feel free to move the test code from src/test/groovy/util to src/main/groovy/util.