Skip to content

Commit

Permalink
TST: Add test for gh-23276
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Feb 26, 2023
1 parent f099fc1 commit 9b1ca14
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions numpy/f2py/tests/src/crackfortran/data_stmts.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
! gh-23276
module cmplxdat
implicit none
integer :: i, j
real :: x, y
complex(kind=8), target :: medium_ref_index

data i, j / 2, 3 /
data x, y / 1.5, 2.0 /
data medium_ref_index / (1.d0, 0.d0) /
end module cmplxdat
17 changes: 17 additions & 0 deletions numpy/f2py/tests/test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os
import pytest
import numpy as np

from . import util


class TestData(util.F2PyTest):
sources = [util.getpath("tests", "src", "crackfortran", "data_stmts.f90")]

# For gh-23276
def test_data_stmts(self):
assert self.module.cmplxdat.i == 2
assert self.module.cmplxdat.j == 3
assert self.module.cmplxdat.x == 1.5
assert self.module.cmplxdat.y == 2.0
assert self.module.cmplxdat.medium_ref_index == np.array(1.+0.j)

0 comments on commit 9b1ca14

Please sign in to comment.