test_construct_ISO8601Date Subroutine

public subroutine test_construct_ISO8601Date()

Arguments

None

Calls

proc~~test_construct_iso8601date~~CallsGraph proc~test_construct_iso8601date test_construct_ISO8601Date assertequal assertequal proc~test_construct_iso8601date->assertequal proc~get_day ISO8601Date%get_day proc~test_construct_iso8601date->proc~get_day proc~get_month ISO8601Date%get_month proc~test_construct_iso8601date->proc~get_month proc~get_year ISO8601Date%get_year proc~test_construct_iso8601date->proc~get_year

Source Code

   subroutine test_construct_ISO8601Date()
      type(ISO8601Date) :: isodate
      integer :: year = 2022
      integer :: month = 07
      integer :: day = 07
      character(len=*), parameter :: delimited = '2022-07-07'
      character(len=*), parameter :: undelimited = '20220707'
      integer :: status

      isodate = ISO8601Date(delimited, rc = status)

      @assertEqual(SUCCESS, status)
      @assertEqual(year, isodate%get_year())
      @assertEqual(month, isodate%get_month())
      @assertEqual(day, isodate%get_day())

      isodate = ISO8601Date(undelimited, rc = status)

      @assertEqual(SUCCESS, status)
      @assertEqual(year, isodate%get_year())
      @assertEqual(month, isodate%get_month())
      @assertEqual(day, isodate%get_day())

   end subroutine test_construct_ISO8601Date