additional tests for escape sequences in raw strings
authorStefan Behnel <scoder@users.berlios.de>
Wed, 12 Jan 2011 21:39:57 +0000 (22:39 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 12 Jan 2011 21:39:57 +0000 (22:39 +0100)
tests/run/strliterals.pyx

index 87bd6e29037d695543553dec0f182725749582e7..f45b867b012b2a7134b651e7538866d15c880ea7 100644 (file)
@@ -104,6 +104,27 @@ __doc__ = ur"""
     >>> len(u6)
     7
 
+    >>> sresc
+    '\\12\\\'\\"\\\\'
+    >>> sresc == r'\12\'\"\\'
+    True
+    >>> len(sresc)
+    9
+
+    >>> bresc
+    b'\\12\\\'\\"\\\\'
+    >>> bresc == br'\12\'\"\\'
+    True
+    >>> len(bresc)
+    9
+
+    >>> uresc
+    u'\\12\\\'\\"\\\\'
+    >>> bresc == ur'\12\'\"\\'
+    True
+    >>> len(uresc)
+    9
+
     >>> newlines == "Aaa\n"
     True
     
@@ -136,6 +157,10 @@ u4 = Ur"abc\x11"
 u5 = uR"abc\x11"
 u6 = UR"abc\x11"
 
+sresc =  r'\12\'\"\\'
+bresc = br'\12\'\"\\'
+uresc = ur'\12\'\"\\'
+
 newlines = "Aaa\n"
 
 # T640, long literals with escapes