From: Stefan Behnel Date: Sat, 21 Feb 2009 20:28:54 +0000 (+0100) Subject: unicode test fixes X-Git-Tag: 0.11.rc~61 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f630c04fad2e462745fe83068d57452ddb0d18b4;p=cython.git unicode test fixes --- diff --git a/tests/run/call_crash.pyx b/tests/run/call_crash.pyx index 6131d896..355fa081 100644 --- a/tests/run/call_crash.pyx +++ b/tests/run/call_crash.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> A().test(3) 9 """ diff --git a/tests/run/carrays.pyx b/tests/run/carrays.pyx index ca6fd072..30e86c3f 100644 --- a/tests/run/carrays.pyx +++ b/tests/run/carrays.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> test1() 2 >>> test2() diff --git a/tests/run/cdef_opt.pyx b/tests/run/cdef_opt.pyx index e1751fa1..cd03ce59 100644 --- a/tests/run/cdef_opt.pyx +++ b/tests/run/cdef_opt.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> a = A() >>> a.foo() (True, 'yo') diff --git a/tests/run/cdefassign.pyx b/tests/run/cdefassign.pyx index eba76a96..bb0ebab8 100644 --- a/tests/run/cdefassign.pyx +++ b/tests/run/cdefassign.pyx @@ -1,5 +1,4 @@ - -__doc__ = """ +__doc__ = u""" >>> test(1, 2) 4 1 2 2 0 7 8 """ diff --git a/tests/run/cmp.pyx b/tests/run/cmp.pyx index 44cf6c67..7cb9c05e 100644 --- a/tests/run/cmp.pyx +++ b/tests/run/cmp.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> single_py(1, 2) True >>> single_py(2, 1) diff --git a/tests/run/extmember.pyx b/tests/run/extmember.pyx index c1b958a6..1bd9d018 100644 --- a/tests/run/extmember.pyx +++ b/tests/run/extmember.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> s = Spam() >>> s.e = s >>> s.e = 1 diff --git a/tests/run/fmod.pyx b/tests/run/fmod.pyx index 0bbd76b8..29158aba 100644 --- a/tests/run/fmod.pyx +++ b/tests/run/fmod.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> fmod(7, 1.25) 0.75 """ diff --git a/tests/run/future_division.pyx b/tests/run/future_division.pyx index 5f78dafc..cfb948f9 100644 --- a/tests/run/future_division.pyx +++ b/tests/run/future_division.pyx @@ -1,6 +1,6 @@ from __future__ import division -__doc__ = """ +__doc__ = u""" >>> from future_division import doit >>> doit(1,2) (0.5, 0) diff --git a/tests/run/future_unicode_literals.pyx b/tests/run/future_unicode_literals.pyx index 4e932cbf..ada73368 100644 --- a/tests/run/future_unicode_literals.pyx +++ b/tests/run/future_unicode_literals.pyx @@ -2,14 +2,14 @@ from __future__ import unicode_literals import sys if sys.version_info[0] >= 3: - __doc__ = """ + __doc__ = u""" >>> u == 'test' True >>> isinstance(u, str) True """ else: - __doc__ = """ + __doc__ = u""" >>> u == u'test' True >>> isinstance(u, unicode) diff --git a/tests/run/int_literals.pyx b/tests/run/int_literals.pyx index 44fec858..bacc0722 100644 --- a/tests/run/int_literals.pyx +++ b/tests/run/int_literals.pyx @@ -1,10 +1,15 @@ -__doc__ = """ +__doc__ = u""" >>> c_longs() (1, 1L, -1L, 18446744073709551615L) >>> py_longs() (1, 1L, 100000000000000000000000000000000L, -100000000000000000000000000000000L) """ +import sys + +if sys.version_info[0] >= 3: + __doc__ = __doc__.replace(u'L', u'') + def c_longs(): cdef long a = 1L cdef unsigned long ua = 1UL diff --git a/tests/run/iteratorexception.pyx b/tests/run/iteratorexception.pyx index 98f9806f..f2726a10 100644 --- a/tests/run/iteratorexception.pyx +++ b/tests/run/iteratorexception.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> f() """ diff --git a/tests/run/literal_lists.pyx b/tests/run/literal_lists.pyx index 0c935356..5925c69e 100644 --- a/tests/run/literal_lists.pyx +++ b/tests/run/literal_lists.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> test_ints(100) (100, 100, 100) >>> test_chars("yo") diff --git a/tests/run/longlongindex.pyx b/tests/run/longlongindex.pyx index 87dcfe5e..22ec638e 100644 --- a/tests/run/longlongindex.pyx +++ b/tests/run/longlongindex.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> D = set_longlong(2**40, 2**50, 2, "yelp") >>> D[2**40] 'yelp' diff --git a/tests/run/pure.pyx b/tests/run/pure.pyx index 44b29961..38910a8e 100644 --- a/tests/run/pure.pyx +++ b/tests/run/pure.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> test_sizeof() True True diff --git a/tests/run/slice_charptr.pyx b/tests/run/slice_charptr.pyx index 5f7369c7..b7fcef0f 100644 --- a/tests/run/slice_charptr.pyx +++ b/tests/run/slice_charptr.pyx @@ -1,7 +1,7 @@ -__doc__ = """ - >>> do_slice("abcdef", 2, 3) +__doc__ = u""" + >>> do_slice("abcdef".encode(u"ASCII"), 2, 3) ('c', 'cdef', 'ab', 'abcdef') - >>> do_slice("abcdef", 0, 5) + >>> do_slice("abcdef".encode(u"ASCII"), 0, 5) ('abcde', 'abcdef', '', 'abcdef') """ diff --git a/tests/run/struct_conversion.pyx b/tests/run/struct_conversion.pyx index 39921d0f..2234b0e4 100644 --- a/tests/run/struct_conversion.pyx +++ b/tests/run/struct_conversion.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> test_constructor(1,2,255) {'y': 2.0, 'x': 1.0, 'color': 255} >>> test_constructor(1,None,255) diff --git a/tests/run/temps_corner1.pyx b/tests/run/temps_corner1.pyx index bade9629..5d454ddc 100644 --- a/tests/run/temps_corner1.pyx +++ b/tests/run/temps_corner1.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> B().coeffs_bitsize() [2] """ diff --git a/tests/run/unsigned.pyx b/tests/run/unsigned.pyx index 86d2cda7..8fdb2c3f 100644 --- a/tests/run/unsigned.pyx +++ b/tests/run/unsigned.pyx @@ -1,4 +1,4 @@ -__doc__ = """ +__doc__ = u""" >>> test_signed() 3 9