added test case from Pyrex rev 96
authorStefan Behnel <scoder@users.berlios.de>
Wed, 11 Jun 2008 18:14:35 +0000 (20:14 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 11 Jun 2008 18:14:35 +0000 (20:14 +0200)
tests/run/r_uintindex.pyx [new file with mode: 0644]

diff --git a/tests/run/r_uintindex.pyx b/tests/run/r_uintindex.pyx
new file mode 100644 (file)
index 0000000..977071e
--- /dev/null
@@ -0,0 +1,16 @@
+__doc__ = u"""
+>>> print idx_uint( ["buckle", "my", "shoe"], 2)
+shoe
+>>> print idx_ulong(["buckle", "my", "shoe"], 2)
+shoe
+"""
+
+def idx_ulong(seq, i):
+    cdef unsigned long u
+    u = i
+    return seq[u]
+
+def idx_uint(seq, i):
+    cdef unsigned int u
+    u = i
+    return seq[u]