extensive test case for unicode literals
authorStefan Behnel <scoder@users.berlios.de>
Thu, 6 Mar 2008 10:16:08 +0000 (11:16 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 6 Mar 2008 10:16:08 +0000 (11:16 +0100)
tests/run/unicodeliterals.pyx [new file with mode: 0644]

diff --git a/tests/run/unicodeliterals.pyx b/tests/run/unicodeliterals.pyx
new file mode 100644 (file)
index 0000000..3a0b5d0
--- /dev/null
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+__doc__ = r"""
+    >>> sa
+    'abc'
+    >>> ua
+    u'abc'
+    >>> b
+    u'123'
+    >>> c
+    u'S\xf8k ik'
+    >>> d
+    u'\xfc\xd6\xe4'
+    >>> e
+    u'\x03g\xf8\uf8d2S\xf8k ik'
+    >>> f
+    u'\xf8'
+    >>> add
+    u'S\xf8k ik\xfc\xd6\xe4abc'
+""" + u"""
+    >>> sa == 'abc'
+    True
+    >>> ua == u'abc'
+    True
+    >>> b == u'123'
+    True
+    >>> c == u'Søk ik'
+    True
+    >>> d == u'üÖä'
+    True
+    >>> e == u'\x03\x67\xf8\uf8d2Søk ik'
+    True
+    >>> f == u'\xf8'
+    True
+    >>> add == u'Søk ik' + u'üÖä' + 'abc'
+    True
+"""
+
+sa = 'abc'
+ua = u'abc'
+
+b = u'123'
+c = u'Søk ik'
+d = u'üÖä'
+e = u'\x03\x67\xf8\uf8d2Søk ik'
+f = u'\xf8'
+
+add = u'Søk ik' + u'üÖä' + 'abc'