[pypy-commit] pypy default: a JIT test for codecs lookup

alex_gaynor noreply at buildbot.pypy.org
Wed Apr 10 16:50:39 CEST 2013


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r63199:4c7feafa28c3
Date: 2013-04-10 07:50 -0700
http://bitbucket.org/pypy/pypy/changeset/4c7feafa28c3/

Log:	a JIT test for codecs lookup

diff --git a/pypy/module/pypyjit/test_pypy_c/test_string.py b/pypy/module/pypyjit/test_pypy_c/test_string.py
--- a/pypy/module/pypyjit/test_pypy_c/test_string.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_string.py
@@ -237,3 +237,15 @@
         loops = log.loops_by_filename(self.filepath)
         loop, = loops
         loop.match_by_id('callone', '')    # nothing
+
+    def test_lookup_codec(self):
+        log = self.run("""
+        import codecs
+
+        def main(n):
+            for i in xrange(n):
+                codecs.lookup('utf8')  # ID: codecs
+            return i
+        """, [1000])
+        loop, = log.loops_by_filename(self.filepath)
+        loop.match_by_id('codecs', '')


More information about the pypy-commit mailing list