[pypy-svn] r48435 - pypy/branch/pypy-rpython-unicode/translator/test

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Nov 8 20:50:14 CET 2007


Author: cfbolz
Date: Thu Nov  8 20:50:14 2007
New Revision: 48435

Modified:
   pypy/branch/pypy-rpython-unicode/translator/test/test_geninterp.py
Log:
test for geninterp unicode behaviour


Modified: pypy/branch/pypy-rpython-unicode/translator/test/test_geninterp.py
==============================================================================
--- pypy/branch/pypy-rpython-unicode/translator/test/test_geninterp.py	(original)
+++ pypy/branch/pypy-rpython-unicode/translator/test/test_geninterp.py	Thu Nov  8 20:50:14 2007
@@ -44,6 +44,9 @@
         def import_sys_func():
             import sys
             return sys.__name__
+
+        def unicode_test(x):
+            return unicode(x, 'ascii')
 """
 
     def setup_class(cls): 
@@ -275,3 +278,9 @@
         fn = self.build_interpfunc(snippet.t_neg_long)
         result = fn()
         assert result == -132L and type(result) is long
+
+    def test_unicode_with_encoding(self):
+        fn = self.build_interpfunc(snippet.unicode_test)
+        result = fn("abc")
+        assert result == u"abc" and type(result) is unicode
+



More information about the Pypy-commit mailing list