cython-devel
view tests/run/unicodeliterals.pyx @ 399:e005b58d83b8
Fix cdef extern classes
| author | Robert Bradshaw <robertwb@math.washington.edu> |
|---|---|
| date | Tue Apr 08 01:25:09 2008 -0700 (2 years ago) |
| parents | 5e3ecc4b1cbe |
| children | 4cb0e7014a92 |
line source
1 # -*- coding: utf-8 -*-
3 __doc__ = r"""
4 >>> sa
5 'abc'
6 >>> ua
7 u'abc'
8 >>> b
9 u'123'
10 >>> c
11 u'S\xf8k ik'
12 >>> d
13 u'\xfc\xd6\xe4'
14 >>> e
15 u'\x03g\xf8\uf8d2S\xf8k ik'
16 >>> f
17 u'\xf8'
18 >>> add
19 u'S\xf8k ik\xfc\xd6\xe4abc'
20 >>> null
21 u'\x00'
22 """ + """
23 >>> len(sa)
24 3
25 >>> len(ua)
26 3
27 >>> len(b)
28 3
29 >>> len(c)
30 6
31 >>> len(d)
32 3
33 >>> len(e)
34 10
35 >>> len(f)
36 1
37 >>> len(add)
38 12
39 >>> len(null)
40 1
41 """ + u"""
42 >>> sa == 'abc'
43 True
44 >>> ua == u'abc'
45 True
46 >>> b == u'123'
47 True
48 >>> c == u'Søk ik'
49 True
50 >>> d == u'üÖä'
51 True
52 >>> e == u'\x03\x67\xf8\uf8d2Søk ik'
53 True
54 >>> f == u'\xf8'
55 True
56 >>> add == u'Søk ik' + u'üÖä' + 'abc'
57 True
58 >>> null == u'\\x00' # doctest needs a double slash here
59 True
60 """
62 sa = 'abc'
63 ua = u'abc'
65 b = u'123'
66 c = u'Søk ik'
67 d = u'üÖä'
68 e = u'\x03\x67\xf8\uf8d2Søk ik'
69 f = u'\xf8'
71 add = u'Søk ik' + u'üÖä' + 'abc'
72 null = u'\x00'
