Comments for "Testing_DocTest"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Chuck Burgess  [2008-03-08 15:26 UTC]

    How does doctest know to ignore <code> blocks that are not actual doctests? Do doctest <code> blocks and regular documentation <code> blocks co-exist peacefully in the same file? Or will documentation <code> blocks disrupt trying to run a file that contains some doctests and some documentation blocks?
  • Chuck Burgess  [2008-03-08 15:41 UTC]

    Wow... already well-defined interfaces, each with a default implementation, perfectly architected for additional driver implementations for each interface... just wow....
  • David Jean Louis  [2008-03-08 15:54 UTC]

    Thanks Chuck,

    <code></code> blocks are considered doctests blocks as long as an "// expects:" line is found, so yes regular documentation and doctests blocs can perfectly coexist.

    I also tried to make doctest syntax "documentor" as friendly as possible, since the goals of doctesting is to document and test at the same time.
  • Till Klampaeckel  [2008-03-08 19:18 UTC]

    This is a pretty cool idea since it allows developers to re-use examples as tests, and therefor save time, and it makes also sure the examples work. ;-)
  • David Jean Louis  [2008-03-08 19:49 UTC]

    Thanks Till but the idea is not mine eh ;)
    http://docs.python.org/lib/module-doctest.html
    As a fan of this module, I really miss it when I code in PHP.
  • Ken Guest  [2008-03-12 14:21 UTC]

    Nice work!
    It's good to see doctest ported over from python - it's an elegant solution for keeping tests and documentation up-to-date whilst minimising the effort required.

    I noticed with phpcs that your code completely adheres to the PEAR Coding Standards - always a good thing.

    I decided to run phpdt on the packages own code and found that it failed once in
    both Testing/DocTest.php and Testing/DocTest/Finder/Default.php :(
  • David Jean Louis  [2008-03-12 14:34 UTC]

    Thanks for your comment Ken, for the failed tests it's probably a problem with pathes could you mail me the output please ?