summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorda-woods <dw-git@d-woods.co.uk>2022-07-17 18:59:06 +0100
committerda-woods <dw-git@d-woods.co.uk>2022-07-17 18:59:06 +0100
commit771051ab77593b507b91e8041da0c293a5e9dd13 (patch)
treefa9df5c00fa0a3b1307d23f1687a25b569407a63
parent7183d4896804bb7364e296d9146722a41a0a4d56 (diff)
downloadcython-771051ab77593b507b91e8041da0c293a5e9dd13.tar.gz
Added a NULL test
-rw-r--r--tests/run/extra_patma.pyx18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/run/extra_patma.pyx b/tests/run/extra_patma.pyx
new file mode 100644
index 000000000..b2303f45b
--- /dev/null
+++ b/tests/run/extra_patma.pyx
@@ -0,0 +1,18 @@
+# mode: run
+
+cdef bint is_null(int* x):
+ return False # disabled - currently just a parser test
+ match x:
+ case NULL:
+ return True
+ case _:
+ return False
+
+def test_is_null():
+ """
+ >>> test_is_null()
+ """
+ cdef int some_int = 1
+ return # disabled - currently just a parser test
+ assert is_null(&some_int) == False
+ assert is_null(NULL) == True