Remove trailing whitespace.
[cython.git] / tests / run / literals.pyx
index e310860ad61fdfa624b9d68ae81228029cf494a4..0d71625dc5b4749d837776386e78b5ed8cc0a7d4 100644 (file)
@@ -1,8 +1,7 @@
-__doc__ = u"""
-    >>> foo()
-"""
-
 def foo():
+    """
+    >>> foo()
+    """
     a = 42
     a1 = 0123
     a2 = 0xabc
@@ -33,16 +32,42 @@ double quoted string."""
     i = 'This string\
  has an ignored newline.'
     j = 'One-char escapes: \'\"\\\a\b\f\n\r\t\v'
-    k = 'Oct and hex escapes: \1 \12 \123 \x45 \xaf \xAF'
+    k = b'Oct and hex escapes: \1 \12 \123 \x45 \xaf \xAF'
     l = r'''This is\
 a \three \line
 raw string with some backslashes.'''
     m = 'Three backslashed ordinaries: \c\g\+'
-    n = '''Triple single quoted string 
+    n = '''Triple single quoted string
 with ' and " quotes'''
-    o = """Triple double quoted string 
+    o = """Triple double quoted string
 with ' and " quotes"""
     p = "name_like_string"
     q = "NameLikeString2"
     r = "99_percent_un_namelike"
     s = "Not an \escape"
+    t = b'this' b'parrot' b'is' b'resting'
+    u = u'this' u'parrot' u'is' u'resting'
+
+
+def test_float(x):
+    """
+    >>> test_float(1./3)
+    True
+    """
+    return x == 1./3
+
+def test_complex(x):
+    """
+    >>> test_complex(1j/3)
+    True
+    """
+    return x == 0.3333333333333333j
+
+def test_large_int(double x):
+    """
+    >>> test_large_int(0)
+    2e+100
+    """
+    a = x + 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+    a += 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+    return a