summaryrefslogtreecommitdiff
path: root/numpy/f2py/tests/test_crackfortran.py
diff options
context:
space:
mode:
authorDamien Caliste <dcaliste@free.fr>2020-03-27 11:12:47 +0100
committerDamien Caliste <dcaliste@free.fr>2022-01-04 09:22:33 +0100
commit26ff6793904f6a59379b91811e9d2e383aed853c (patch)
tree3c74d4807209d0e7f6dd23c0035f6f3b26613078 /numpy/f2py/tests/test_crackfortran.py
parent20f972ce3693d7700afe51898089613ebe4b3ee5 (diff)
downloadnumpy-26ff6793904f6a59379b91811e9d2e383aed853c.tar.gz
ENH: add inline definition of access rights for Fortran types
Allow to parse type definition with inline acess specifier, like: type, public :: foo end type foo
Diffstat (limited to 'numpy/f2py/tests/test_crackfortran.py')
-rw-r--r--numpy/f2py/tests/test_crackfortran.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/f2py/tests/test_crackfortran.py b/numpy/f2py/tests/test_crackfortran.py
index fb47eb31d..31dfad16e 100644
--- a/numpy/f2py/tests/test_crackfortran.py
+++ b/numpy/f2py/tests/test_crackfortran.py
@@ -44,6 +44,15 @@ class TestPublicPrivate:
assert "private" not in mod["vars"]["seta"]["attrspec"]
assert "public" in mod["vars"]["seta"]["attrspec"]
+ def test_access_type(self, tmp_path):
+ fpath = util.getpath("tests", "src", "crackfortran", "accesstype.f90")
+ mod = crackfortran.crackfortran([str(fpath)])
+ assert len(mod) == 1
+ tt = mod[0]['vars']
+ assert set(tt['a']['attrspec']) == {'private', 'bind(c)'}
+ assert set(tt['b_']['attrspec']) == {'public', 'bind(c)'}
+ assert set(tt['c']['attrspec']) == {'public'}
+
class TestExternal(util.F2PyTest):
# issue gh-17859: add external attribute support