File: //lib/python3/dist-packages/numpy/f2py/tests/__pycache__/test_abstract_interface.cpython-310.pyc
o
6��a � @ s6 d dl Z ddlmZ d dlmZ G dd� dej�ZdS )� N� )�util)�crackfortranc @ s2 e Zd ZdZddgZe�d�Zdd� Zdd� Z d S )
�TestAbstractInterfacez.f90�add1�add2a�
module ops_module
abstract interface
subroutine op(x, y, z)
integer, intent(in) :: x, y
integer, intent(out) :: z
end subroutine
end interface
contains
subroutine foo(x, y, r1, r2)
integer, intent(in) :: x, y
integer, intent(out) :: r1, r2
procedure (op) add1, add2
procedure (op), pointer::p
p=>add1
call p(x, y, r1)
p=>add2
call p(x, y, r2)
end subroutine
end module
subroutine add1(x, y, z)
integer, intent(in) :: x, y
integer, intent(out) :: z
z = x + y
end subroutine
subroutine add2(x, y, z)
integer, intent(in) :: x, y
integer, intent(out) :: z
z = x + 2 * y
end subroutine
c C s | j j�dd�dksJ �d S )N� � )� �
)�module�
ops_module�foo)�self� r �J/usr/lib/python3/dist-packages/numpy/f2py/tests/test_abstract_interface.py�test_abstract_interface0 s z-TestAbstractInterface.test_abstract_interfacec C s� |d }|� d��}|�t�d�� W d � n1 sw Y t�t|�g�}t|�dks1J �t|d d �dks=J �|d d d d dksKJ �d S ) Nzgh18403_mod.f90�wz� module test
abstract interface
subroutine foo()
end subroutine
end interface
end module test
r r �body�blockzabstract interface)�open�write�textwrap�dedentr �str�len)r �tmp_path�f_path�ff�modr r r �test_parse_abstract_interface3 s � z3TestAbstractInterface.test_parse_abstract_interfaceN)
�__name__�
__module__�__qualname__�suffix�skipr r �coder r r r r r r s
%r )r � r �
numpy.f2pyr �F2PyTestr r r r r �<module> s