On Jul 24, 2009, at 11:22 AM, Simon King wrote:

>
> I think  it would be nice to have the possibility to do the following
> in doc tests:
>
> """
> EXAMPLES::
>
>     sage: R.<x,y,z> = QQ[]
>     #<if testflag contains "long">
>     sage: I = ... # some nasty ideal
>     sage: G = I.groebner_basis()
>     #<if (testflag contains "magma") or (testflag contains "optional")
>>
>     sage: GM = I.groebner_basis(algorithm="magma")
>     sage: G == GM
>     True
>     #<end if>
>     #<else>
>      sage: I = ... # some less nasty ideal
>     sage: G = I.groebner_basis()
>     #<end if>
>     sage: p = ... # some ideal that both belongs to the nasty and the
> less nasty ideal
>     sage: p.reduce(G)
>     0
>
> """

Doctests are for human consumption, as well as automated testing, and  
I find the above nested if statements hard to visually parse.

If one wants, one can do

sage: m = None
sage: m = massive_calculation() # long time
sage: if m:
...: m.do_something()

Also, I think -t -long should be a superset of plain old -t, as  
should all extra testing options.

- Robert

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to