Commit f630c04f authored by Stefan Behnel's avatar Stefan Behnel

unicode test fixes

parent f0a69791
__doc__ = """ __doc__ = u"""
>>> A().test(3) >>> A().test(3)
9 9
""" """
......
__doc__ = """ __doc__ = u"""
>>> test1() >>> test1()
2 2
>>> test2() >>> test2()
......
__doc__ = """ __doc__ = u"""
>>> a = A() >>> a = A()
>>> a.foo() >>> a.foo()
(True, 'yo') (True, 'yo')
......
__doc__ = u"""
__doc__ = """
>>> test(1, 2) >>> test(1, 2)
4 1 2 2 0 7 8 4 1 2 2 0 7 8
""" """
......
__doc__ = """ __doc__ = u"""
>>> single_py(1, 2) >>> single_py(1, 2)
True True
>>> single_py(2, 1) >>> single_py(2, 1)
......
__doc__ = """ __doc__ = u"""
>>> s = Spam() >>> s = Spam()
>>> s.e = s >>> s.e = s
>>> s.e = 1 >>> s.e = 1
......
__doc__ = """ __doc__ = u"""
>>> fmod(7, 1.25) >>> fmod(7, 1.25)
0.75 0.75
""" """
......
from __future__ import division from __future__ import division
__doc__ = """ __doc__ = u"""
>>> from future_division import doit >>> from future_division import doit
>>> doit(1,2) >>> doit(1,2)
(0.5, 0) (0.5, 0)
......
...@@ -2,14 +2,14 @@ from __future__ import unicode_literals ...@@ -2,14 +2,14 @@ from __future__ import unicode_literals
import sys import sys
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
__doc__ = """ __doc__ = u"""
>>> u == 'test' >>> u == 'test'
True True
>>> isinstance(u, str) >>> isinstance(u, str)
True True
""" """
else: else:
__doc__ = """ __doc__ = u"""
>>> u == u'test' >>> u == u'test'
True True
>>> isinstance(u, unicode) >>> isinstance(u, unicode)
......
__doc__ = """ __doc__ = u"""
>>> c_longs() >>> c_longs()
(1, 1L, -1L, 18446744073709551615L) (1, 1L, -1L, 18446744073709551615L)
>>> py_longs() >>> py_longs()
(1, 1L, 100000000000000000000000000000000L, -100000000000000000000000000000000L) (1, 1L, 100000000000000000000000000000000L, -100000000000000000000000000000000L)
""" """
import sys
if sys.version_info[0] >= 3:
__doc__ = __doc__.replace(u'L', u'')
def c_longs(): def c_longs():
cdef long a = 1L cdef long a = 1L
cdef unsigned long ua = 1UL cdef unsigned long ua = 1UL
......
__doc__ = """ __doc__ = u"""
>>> f() >>> f()
""" """
......
__doc__ = """ __doc__ = u"""
>>> test_ints(100) >>> test_ints(100)
(100, 100, 100) (100, 100, 100)
>>> test_chars("yo") >>> test_chars("yo")
......
__doc__ = """ __doc__ = u"""
>>> D = set_longlong(2**40, 2**50, 2, "yelp") >>> D = set_longlong(2**40, 2**50, 2, "yelp")
>>> D[2**40] >>> D[2**40]
'yelp' 'yelp'
......
__doc__ = """ __doc__ = u"""
>>> test_sizeof() >>> test_sizeof()
True True
True True
......
__doc__ = """ __doc__ = u"""
>>> do_slice("abcdef", 2, 3) >>> do_slice("abcdef".encode(u"ASCII"), 2, 3)
('c', 'cdef', 'ab', 'abcdef') ('c', 'cdef', 'ab', 'abcdef')
>>> do_slice("abcdef", 0, 5) >>> do_slice("abcdef".encode(u"ASCII"), 0, 5)
('abcde', 'abcdef', '', 'abcdef') ('abcde', 'abcdef', '', 'abcdef')
""" """
......
__doc__ = """ __doc__ = u"""
>>> test_constructor(1,2,255) >>> test_constructor(1,2,255)
{'y': 2.0, 'x': 1.0, 'color': 255} {'y': 2.0, 'x': 1.0, 'color': 255}
>>> test_constructor(1,None,255) >>> test_constructor(1,None,255)
......
__doc__ = """ __doc__ = u"""
>>> B().coeffs_bitsize() >>> B().coeffs_bitsize()
[2] [2]
""" """
......
__doc__ = """ __doc__ = u"""
>>> test_signed() >>> test_signed()
3 <type 'int'> 3 <type 'int'>
9 <type 'long'> 9 <type 'long'>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment