Doctest Mode: Walk-Through (4/8)

Now that we have some test cases, let's run doctest: type "control-c control-c". Doctest is run asynchronously, and when its done, a new buffer containing its output is displayed.

Of course, since we haven't added the expected output for our test cases, they'll all fail. But that's ok! doctest-mode will help us to replace their incorrect outputs with the correct ones.

Next Page...

Hello world.  This file will contain some simple tests.

    >>> len('european swallow')
    >>> 'european swallow'.count('a')
    >>> for word in 'european swallow'.split():
    ...     print word, len(word)

.

ISO8---Emacs: mytest.doctest  (Doctest Font Fill)----L2--All-----
************************************************************
File "/tmp/mytest.doctest", line 2, in mytest.doctest
Failed example:
    len('european swallow')
Expected nothing
Got:
    16
************************************************************
File "/tmp/mytest.doctest", line 3, in mytest.doctest
Failed example:
    'european swallow'.count('a')
Expected nothing
Got:
ISO8---Emacs: *doctest-output* (Doctest Results Font)----L1--All-