I've found a very weird error trying to get some files pass the
automated testing: I got the same "Expected" and "Got", but the test
failed. Copy the following text to devel/sage/sage/misc/example.py:

# -*- coding: utf-8 -*

def f(text):
    """

    EXAMPLES::

        sage: from sage.misc.example import f
        sage: s="a=2"
        sage: f(s)
        '::\n\n sage: a=2'
    """
    lines = ['::', '']
    prefix=' sage: '
    for s in text.splitlines():
        lines.append(prefix + s)
    return '\n'.join(lines)

And you get a weird error:

File
"/home/moriarty/Software/sage-4.6.1-linux-32bit-ubuntu_10.04_lts-i686-Linux/devel/sage-main/sage/misc/example.py",
line 10:
    sage: f(s)
Expected:
    '::\n\n sage: a=2'
Got:
    '::\n\n sage: a=2'
**********************************************************************

but then make the following simple changes (change prefix from ' sage: '
to ' sag: '):

# -*- coding: utf-8 -*

def f(text):
    """

    EXAMPLES::

        sage: from sage.misc.example import f
        sage: s="a=2"
        sage: f(s)
        '::\n\n sag: a=2'
    """
    lines = ['::', '']
    prefix=' sag: '
    for s in text.splitlines():
        lines.append(prefix + s)
    return '\n'.join(lines)

and all tests pass!! They also seem to pass with any prefix that does
not contain the string 'sage:'.
I need to write some tests whose result contain 'sage:': can you help?

Regards

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
# -*- coding: utf-8 -*

def f(text):
    """

    EXAMPLES::

        sage: from sage.misc.example import f
        sage: s="a=2"
        sage: f(s)
        '::\n\n sage: a=2'
    """
    lines = ['::', '']
    prefix=' sage: '
    for s in text.splitlines():
        lines.append(prefix + s)
    return '\n'.join(lines)

Reply via email to