On Thu, Oct 2, 2008 at 12:28 AM, didier deshommes <[EMAIL PROTECTED]> wrote:
>
> Ok, I've got a patch and I've looked at the generated C code, compiled
> the module and verified the behavior of the function. How do I write
> tests for cython? Do I just edit tests/run/dict.pyx and look at the
> generated code?

More or less, yes. Write a 'set.pyx' file like this:

__doc__ = u"""
>>> test_set()
True
"""

def test_set():
    cdef set s1 = set()
    cdef set s2 = set()
    # then do stuff with s1 and s2, like s1.add(1)
    # finally return True
    return True


Of course, I do not know if this can be readily incorporated in Cython
test suite, provided that this code is going to fail  in the case of a
Python 2.3 runtime.


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to