Skip to content

Commit

Permalink
Add test for (currently broken) returning character array with runtim…
Browse files Browse the repository at this point in the history
…e size
  • Loading branch information
rjfarmer committed Feb 27, 2024
1 parent 45efbd7 commit 53ad75b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/strings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,29 @@ def test_check_str_opt(self):

res = x.check_str_opt("abcd", 4)
assert res.result == 4

@pytest.mark.skip("Currently under development")
def test_func_str_return_array(self):
fstr = """
recursive function return_char(x) result(str)
implicit none
integer, intent(in) :: x
character(len=10), dimension((2 ** x - 1) ) :: str
str = ''
str(2**x-1) = 'abcdefghil'
end function return_char
"""

size = 2
z = gf.compile(fstr)

res = z.return_char(size)

return_str = res.result

assert np.size(np.shape(return_str)) == ((2**size) - 1)
assert return_str[-1] == "abcdefghij"

0 comments on commit 53ad75b

Please sign in to comment.