Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
TST: Add a test for gh-23598
  • Loading branch information
HaoZeke committed Apr 16, 2023
commit f96b8daea959db191ff84b80dbc1ea948722fbaa
4 changes: 4 additions & 0 deletions numpy/f2py/tests/src/crackfortran/gh23598.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
integer function intproduct(a, b) result(res)
integer, intent(in) :: a, b
res = a*b
end function
10 changes: 9 additions & 1 deletion numpy/f2py/tests/test_crackfortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,12 @@ def test_nameargspattern_backtracking(self, adversary):
# we accept that maybe the median might double once, due to
# the CPU scheduler acting weird or whatever. More than that
# seems suspicious.
assert times_median_doubled < 2
assert times_median_doubled < 2


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

def test_function_rettype(self):
# gh-23598
assert self.module.intproduct(3, 4) == 12