test_undelimit Subroutine

public subroutine test_undelimit()

Arguments

None

Calls

proc~~test_undelimit~2~~CallsGraph proc~test_undelimit~2 test_undelimit assertequal assertequal proc~test_undelimit~2->assertequal asserttrue asserttrue proc~test_undelimit~2->asserttrue proc~undelimit undelimit proc~test_undelimit~2->proc~undelimit

Source Code

   subroutine test_undelimit()
      character(len=32), parameter :: UNDELIMITED_DATE = '20220720'
      character(len=32), parameter :: DATE ='2022-07-20' 
      character(len=32), parameter :: UNDELIMITED_TIME1 = '153437'
      character(len=32), parameter :: TIME1 = '15:34:37'
      character(len=32), parameter :: UNDELIMITED_TIME2 = '153437421'
      character(len=32), parameter :: TIME2 = '15:34:37.421'
      integer, parameter :: DATEWIDTH = len_trim(UNDELIMITED_DATE)
      integer, parameter :: TIMEWIDTH1 = len_trim(UNDELIMITED_TIME1)
      integer, parameter :: TIMEWIDTH2 = len_trim(UNDELIMITED_TIME2)

      @assertEqual(trim(UNDELIMITED_DATE), trim(undelimit(DATE,'-')))
      @assertEqual(DATEWIDTH, len_trim(UNDELIMITED_DATE)) 
      @assertEqual(trim(UNDELIMITED_TIME1), trim(undelimit(TIME1,':')))
      @assertEqual(TIMEWIDTH1, len_trim(UNDELIMITED_TIME1))
      @assertEqual(trim(UNDELIMITED_TIME2), trim(undelimit(undelimit(TIME2,':'),'.')))
      @assertEqual(TIMEWIDTH2, len_trim(UNDELIMITED_TIME2))
      @assertTrue(trim(UNDELIMITED_TIME1) /= trim(undelimit(TIME1,'.')))
      @assertEqual(trim(UNDELIMITED_TIME1), trim(undelimit(UNDELIMITED_TIME1,':')))
      @assertEqual('', trim(undelimit('',':')))
   end subroutine test_undelimit