test_datetime Subroutine

public subroutine test_datetime()

Arguments

None

Calls

proc~~test_datetime~~CallsGraph proc~test_datetime test_datetime assert_that assert_that proc~test_datetime->assert_that false false proc~test_datetime->false proc~is_valid_datetime is_valid_datetime proc~test_datetime->proc~is_valid_datetime true true proc~test_datetime->true proc~is_valid_date is_valid_date proc~is_valid_datetime->proc~is_valid_date proc~is_valid_time is_valid_time proc~is_valid_datetime->proc~is_valid_time

Source Code

   subroutine test_datetime()

      integer :: datetime(2)

      ! Simple test
      datetime = [20000101,120000]
      @assert_that(is_valid_datetime(datetime), is(true()))

      ! Bad date
      datetime = [20001301,120000]
      @assert_that(is_valid_datetime(datetime), is(false()))

      ! Bad time
      datetime = [20000101,250000]
      @assert_that(is_valid_datetime(datetime), is(false()))

   end subroutine test_datetime