migrate to doctest
compilable test.