Author: Antonio Cuni <[email protected]>
Branch: cpyext-fast-typecheck
Changeset: r94030:c05e38122aa5
Date: 2018-03-20 15:09 +0100
http://bitbucket.org/pypy/pypy/changeset/c05e38122aa5/
Log: (anto, matti): add a passing test
diff --git a/pypy/module/cpyext/test/test_sliceobject.py
b/pypy/module/cpyext/test/test_sliceobject.py
--- a/pypy/module/cpyext/test/test_sliceobject.py
+++ b/pypy/module/cpyext/test/test_sliceobject.py
@@ -79,3 +79,14 @@
"""),
])
assert module.get_ellipsis() is Ellipsis
+
+ def test_typecheck(self):
+ module = self.import_extension('foo', [
+ ("check", "METH_O",
+ """
+ PySliceObject *slice = (PySliceObject *)args;
+ return PyLong_FromLong(PySlice_Check(slice));
+ """),
+ ])
+ s = slice(10, 20, 30)
+ assert module.check(s)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit