test_parse_date Subroutine

public subroutine test_parse_date()

Arguments

None

Calls

proc~~test_parse_date~~CallsGraph proc~test_parse_date test_parse_date assertequal assertequal proc~test_parse_date->assertequal asserttrue asserttrue proc~test_parse_date->asserttrue proc~parse_date parse_date proc~test_parse_date->proc~parse_date proc~is_valid_date~2 is_valid_date proc~parse_date->proc~is_valid_date~2 proc~read_whole_number read_whole_number proc~parse_date->proc~read_whole_number proc~undelimit undelimit proc~parse_date->proc~undelimit proc~get_month_end get_month_end proc~is_valid_date~2->proc~get_month_end proc~is_between is_between proc~is_valid_date~2->proc~is_between proc~is_valid_month is_valid_month proc~is_valid_date~2->proc~is_valid_month proc~is_valid_year is_valid_year proc~is_valid_date~2->proc~is_valid_year proc~read_whole_number_indexed read_whole_number_indexed proc~read_whole_number->proc~read_whole_number_indexed proc~get_month_ends get_month_ends proc~get_month_end->proc~get_month_ends proc~is_valid_month->proc~is_between proc~is_valid_year->proc~is_between proc~get_integer_digit_from_string get_integer_digit_from_string proc~read_whole_number_indexed->proc~get_integer_digit_from_string proc~is_whole_number is_whole_number proc~read_whole_number_indexed->proc~is_whole_number

Source Code

   subroutine test_parse_date()
      type(date_fields) :: date

      date = parse_date('2022-07-07')
      @assertTrue(date%is_valid_)
      @assertEqual(2022, date%year_)
      @assertEqual(7, date%month_)
      @assertEqual(7, date%day_)

      date = parse_date('20220707')
      @assertTrue(date%is_valid_)
      @assertEqual(2022, date%year_)
      @assertEqual(7, date%month_)
      @assertEqual(7, date%day_)
   end subroutine test_parse_date