wolverine2k / crunchy

Automatically exported from code.google.com/p/crunchy
0 stars 0 forks source link

Enhanced doctest #203

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Improve the doctest mode (and unittest) so that some tests can be hidden. 

For example: suppose we give the user the following doctest:
>>> square(4)
16
>>> square(-2)
4

A user could define a function with an if/else branch that would simply
return the desired (known) answer given the input.  Having some hidden
tests, as in

>>> for i in range(10):
...      assert square(i) == i*i

would prevent this from happening.

Original issue reported on code.google.com by andre.ro...@gmail.com on 1 Aug 2009 at 3:27

GoogleCodeExporter commented 8 years ago
Since the user would not see the hidden code, as a security measure, the user 
should
have to click a button (html radio?) prior to code execution, confirming that 
it is
understood that some hidden code will be executed.

Original comment by andre.ro...@gmail.com on 1 Aug 2009 at 4:46