8000 TST: Add test for gh-23276 · numpy/numpy@9b1ca14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b1ca14

Browse files
committed
TST: Add test for gh-23276
1 parent f099fc1 commit 9b1ca14

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
! gh-23276
2+
module cmplxdat
3+
implicit none
4+
integer :: i, j
5+
real :: x, y
6+
complex(kind=8), target :: medium_ref_index
7+
8+
data i, j / 2, 3 /
9+
data x, y / 1.5, 2.0 /
10+
data medium_ref_index / (1.d0, 0.d0) /
11+
end module cmplxdat

numpy/f2py/tests/test_data.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
import pytest
3+
import numpy as np
4+
5+
from . import util
6+
7+
8+
class TestData(util.F2PyTest):
9+
sources = [util.getpath("tests", "src", "crackfortran", "data_stmts.f90")]
10+
11+
# For gh-23276
12+
def test_data_stmts(self):
13+
assert self.module.cmplxdat.i == 2
14+
assert self.module.cmplxdat.j == 3
15+
assert self.module.cmplxdat.x == 1.5
16+
assert self.module.cmplxdat.y == 2.0
17+
assert self.module.cmplxdat.medium_ref_index == np.array(1.+0.j)

0 commit comments

Comments
 (0)
0