test_serialize_string Subroutine

public subroutine test_serialize_string()

Arguments

None

Calls

proc~~test_serialize_string~~CallsGraph proc~test_serialize_string test_serialize_string anyexceptions anyexceptions proc~test_serialize_string->anyexceptions assertequal assertequal proc~test_serialize_string->assertequal interface~deserialize_intrinsic deserialize_intrinsic proc~test_serialize_string->interface~deserialize_intrinsic interface~serialize_intrinsic serialize_intrinsic proc~test_serialize_string->interface~serialize_intrinsic

Source Code

   subroutine test_serialize_string()
      !character(len=:), allocatable :: str

      !call check(str); if (anyExceptions()) return
      call check(''); if (anyExceptions()) return
      call check('a'); if (anyExceptions()) return
      call check('ab'); if (anyExceptions()) return
      call check('abc'); if (anyExceptions()) return
      call check('abcd'); if (anyExceptions()) return
      call check('abcde'); if (anyExceptions()) return
      call check('some very long string '); if (anyExceptions()) return

   contains

      subroutine check(expected)
         character(len=*), intent(in) :: expected
         character(len=:), allocatable :: found

         call deserialize_intrinsic(serialize_intrinsic(expected),found)
         @assertEqual(expected, found)

      end subroutine check

   end subroutine test_serialize_string