[Python-3000-checkins] r62166 - python/branches/py3k/Lib/test/test_unicode.py

Eric Smith eric+python-dev at trueblade.com
Sat Apr 5 17:27:32 CEST 2008


I think a better test here would be what it _should_ equal, namely 
'\\u0020', or maybe '\\' + 'u0020', if you want to remove '\u' from the 
test string.  As written, any string other than a space would pass, for 
example if this became '\\\\u0020' through some other error.


benjamin.peterson wrote:
> Author: benjamin.peterson
> Date: Sat Apr  5 17:09:30 2008
> New Revision: 62166
> 
> Modified:
>    python/branches/py3k/Lib/test/test_unicode.py
> Log:
> Added a test to make sure raw strings don't get unicode escapes
> 
> 
> Modified: python/branches/py3k/Lib/test/test_unicode.py
> ==============================================================================
> --- python/branches/py3k/Lib/test/test_unicode.py	(original)
> +++ python/branches/py3k/Lib/test/test_unicode.py	Sat Apr  5 17:09:30 2008
> @@ -68,6 +68,8 @@
>          self.assertRaises(SyntaxError, eval, '\'\\Ufffffffe\'')
>          self.assertRaises(SyntaxError, eval, '\'\\Uffffffff\'')
>          self.assertRaises(SyntaxError, eval, '\'\\U%08x\'' % 0x110000)
> +        # raw strings should not have unicode escapes
> +        self.assertNotEquals(r"\u0020", " ")
>  
>      def test_repr(self):
>          if not sys.platform.startswith('java'):
> _______________________________________________
> Python-3000-checkins mailing list
> Python-3000-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-3000-checkins
> 



More information about the Python-3000-checkins mailing list