Skip to content

Commit

Permalink
#426 add further test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
arporter committed Jan 10, 2024
1 parent 85cabb3 commit 3d0b6a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/fparser/two/tests/fortran2003/test_openstmt_r904.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ def test_open_stmt():
obj = tcls("open(unit=23, file='some_file.txt')")
assert isinstance(obj, tcls)
assert str(obj) == "OPEN(UNIT = 23, FILE = 'some_file.txt')"
obj = tcls("open(unit=23, file='some_file.txt', convert=endianness)")
assert isinstance(obj, tcls)
assert str(obj) == "OPEN(UNIT = 23, FILE = 'some_file.txt', CONVERT = endianness)"
obj = tcls("OPEN (993,FILE=FNAMETAB,form='UNFORMATTED',convert=file_endian,IOSTAT=IERR,STATUS='OLD')")
assert isinstance(obj, tcls)
assert str(obj) == "OPEN(UNIT = 993, FILE = FNAMETAB, FORM = 'UNFORMATTED', CONVERT = file_endian, IOSTAT = IERR, STATUS = 'OLD')"
# Incorrect spelling of OPEN.
with pytest.raises(NoMatchError) as err:
tcls("opn(23, file='yada')")
Expand Down

0 comments on commit 3d0b6a0

Please sign in to comment.