OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
numpy
/
f2py
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 05:59:26 AM
rwxr-xr-x
📄
__init__.py
0 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📁
__pycache__
-
10/28/2024 05:59:26 AM
rwxr-xr-x
📁
src
-
10/28/2024 05:59:26 AM
rwxr-xr-x
📄
test_array_from_pyobj.py
21.46 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_assumed_shape.py
1.55 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_block_docstring.py
621 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_callback.py
3.89 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_common.py
802 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_compile_function.py
4.21 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_crackfortran.py
2.73 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_kind.py
1012 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_mixed.py
911 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_parameter.py
3.82 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_quoted_character.py
927 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_regression.py
698 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_character.py
3.83 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_complex.py
4.51 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_integer.py
4.47 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_logical.py
4.73 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_return_real.py
5.28 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_semicolon_split.py
1.48 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_size.py
1.26 KB
10/28/2024 05:59:24 AM
rw-r--r--
📄
test_string.py
610 bytes
10/28/2024 05:59:24 AM
rw-r--r--
📄
util.py
9.39 KB
10/28/2024 05:59:24 AM
rw-r--r--
Editing: test_crackfortran.py
Close
import numpy as np from numpy.testing import assert_array_equal from . import util from numpy.f2py import crackfortran import tempfile import textwrap class TestNoSpace(util.F2PyTest): # issue gh-15035: add handling for endsubroutine, endfunction with no space # between "end" and the block name code = """ subroutine subb(k) real(8), intent(inout) :: k(:) k=k+1 endsubroutine subroutine subc(w,k) real(8), intent(in) :: w(:) real(8), intent(out) :: k(size(w)) k=w+1 endsubroutine function t0(value) character value character t0 t0 = value endfunction """ def test_module(self): k = np.array([1, 2, 3], dtype=np.float64) w = np.array([1, 2, 3], dtype=np.float64) self.module.subb(k) assert_array_equal(k, w + 1) self.module.subc([w, k]) assert_array_equal(k, w + 1) assert self.module.t0(23) == b'2' class TestPublicPrivate(): def test_defaultPrivate(self, tmp_path): f_path = tmp_path / "mod.f90" with f_path.open('w') as ff: ff.write(textwrap.dedent("""\ module foo private integer :: a public :: setA integer :: b contains subroutine setA(v) integer, intent(in) :: v a = v end subroutine setA end module foo """)) mod = crackfortran.crackfortran([str(f_path)]) assert len(mod) == 1 mod = mod[0] assert 'private' in mod['vars']['a']['attrspec'] assert 'public' not in mod['vars']['a']['attrspec'] assert 'private' in mod['vars']['b']['attrspec'] assert 'public' not in mod['vars']['b']['attrspec'] assert 'private' not in mod['vars']['seta']['attrspec'] assert 'public' in mod['vars']['seta']['attrspec'] def test_defaultPublic(self, tmp_path): f_path = tmp_path / "mod.f90" with f_path.open('w') as ff: ff.write(textwrap.dedent("""\ module foo public integer, private :: a public :: setA contains subroutine setA(v) integer, intent(in) :: v a = v end subroutine setA end module foo """)) mod = crackfortran.crackfortran([str(f_path)]) assert len(mod) == 1 mod = mod[0] assert 'private' in mod['vars']['a']['attrspec'] assert 'public' not in mod['vars']['a']['attrspec'] assert 'private' not in mod['vars']['seta']['attrspec'] assert 'public' in mod['vars']['seta']['attrspec']