doctest for java

Janto Dreijer janto_d at hotmail.com
Fri Jun 28 19:50:23 EDT 2002


Tim Peters <tim.one at comcast.net> wrote in message
news:<mailman.1025281419.16432.python-list at python.org>...
> [Janto Dreijer]
> > Are there any attempts to port the "doctest" module to Java? (All
> > I can find using google is some testing class for the JavaDoc program
> > calling itself "DocTest".)
> >
> > At a glance it looks like a worthwhile effort...extracting Jython
> > "examples"
> > from /**...*/ comments also seems simple to implement.
>
> Last I heard, Python's std doctest.py worked fine under Jython.  If
anything
> else simple is needed, you're elected <wink>.

I in no way meant your code is trivial. Although I'm starting to think you
did that "import __future__" trick with the sole reason to confuse :-)

I'm actually thinking of running doctests on *.java files and not on *.py
files, so the current doctest.py wouldn't be 100% usable.

class Obj {
    /**
        "Three" is the number it should print. And the number of the
printing should be "three":
        This is a usage example written in Jython...maybe.

        >>> Obj.f()
        3

    */
    public static void f() {
        System.out.println(3);
    }
}

That's it. It can't be helped. I'm spending my weekend on this :-)





More information about the Python-list mailing list