Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholaswogan committed Aug 9, 2022
1 parent bc3aef4 commit cafffc2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pi: asdf d:
1 change: 1 addition & 0 deletions tests/test_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_roundtrip():
fil.close()

assert test2 == test2_copy
print("test_roundtrip passed!")

if __name__ == "__main__":
test_roundtrip()
26 changes: 26 additions & 0 deletions tests/test_yaml.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ program test_yaml
implicit none
call test1()
call test2()
call test3()
call test4()
contains
subroutine test1()
type(YamlFile) :: file
Expand Down Expand Up @@ -33,6 +35,30 @@ subroutine test2()
call file%dump(unit=2, indent=0)
close(2)
end subroutine

subroutine test3()
type(YamlFile) :: file
character(:), allocatable :: err

call file%parse("../tests/test3.yaml", err)
if (.not.allocated(err)) then
stop 1
endif
print*,err

end subroutine

subroutine test4()
type(YamlFile) :: file
character(:), allocatable :: err

call file%parse("../tests/not_a_file.yaml", err)
if (.not.allocated(err)) then
stop 1
endif
print*,err

end subroutine
end program


0 comments on commit cafffc2

Please sign in to comment.