========================
Additional doctest Tests
========================

Most `doctest` module tests are located within the module. This file only
tests a few additional features not covered by the module tests, so that the
changes to the `doctest` module -- which is forked from the Python stanadrd
library -- are minimized.

Working with Carriage Returns
-----------------------------

Due to the way releases are made on different platforms, we sometimes test
files on a *nix system with Windows file endings. Unfortunately, that leaves
some the tests broken:

  >>> import tempfile
  >>> fn = tempfile.mktemp()
  >>> open(fn, 'w').write('Test:\r\n\r\n  >>> x = 1 + 1\r\n\r\nDone.\r\n')

Let's now run it as a doctest:

  >>> from zope.testing import doctest
  >>> doctest.testfile(fn, False)
  (0, 1)

It worked. Let's also try the test file suite:

  >>> import unittest
  >>> result = unittest.TestResult()
  >>> doctest.DocFileSuite(fn, module_relative=False).run(result)
  <unittest.TestResult run=1 errors=0 failures=0>
