Fixed Bugs

Here are demonstrations of various bugs that have been fixed in Manuel. If you encounter a bug in a previous version of Manuel, check here in the newest version to see if your bug has been addressed.

This document is likely only interesting to people using creating their own plug-ins.

Start and End Coinciding

If a line of text matches both a “start” and “end” regular expression, no exception should be raised.

>>> source = """\
... Blah, blah.
...
... xxx
... some text
... xxx
...
... """
>>> import manuel
>>> document = manuel.Document(source)
>>> import re
>>> start = end = re.compile(r'^xxx$', re.MULTILINE)
>>> document.find_regions(start, end)
[<manuel.Region object at ...]

Doctest Doppelganger

The manuel.doctest module should be willing to run doctest Examples from either the standard library’s doctest module, from zope.testing.doctest, or from subclasses of those.

Here’s a failing test we’ll use to make sure this works:

This is my failing doctest.

>>> 1 + 1
42

First we’ll show that it fails using the normal Manuel pieces.

>>> m = manuel.doctest.Manuel()
>>> document.process_with(m, globs={})
>>> print document.formatted(),
File "<memory>", line 3, in <memory>
Failed example:
    1 + 1
Expected:
    42
Got:
    2

Now we’ll create a subclass of zope.testing.doctest.Example, it should work too (but didn’t at one point).

Now if we replace the stdlib doctest.Example in the parsed document, the failure is still reported.

>>> my_example = MyExample('2+2', '88')
>>> region = list(document)[1]
>>> region.parsed = my_example
>>> region.evaluated = None
>>> region.formatted = None
>>> manuel.doctest.evaluate(m, region, document, {})
>>> print region.evaluated.getvalue()
<BLANKLINE>
File "<memory>", line 3, in <memory>
Failed example:
    2+2
Expected:
    88
Got:
    4
<BLANKLINE>

Table Of Contents

Previous topic

FIT Table Example

This Page