Write tests for doctest()