subroutine test_get_time_unit() integer(kind(TIME_UNIT)) :: expected, actual character(len=8) :: unit_name unit_name = 'year' expected = YEAR_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = unit_name // 's' actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = 'month' expected = MONTH_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = unit_name // 's' actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = 'day' expected = DAY_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = unit_name // 's' actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = 'hour' expected = HOUR_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = unit_name // 's' actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = 'minute' expected = MINUTE_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = unit_name // 's' actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = 'second' expected = SECOND_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = unit_name // 's' actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) unit_name = 'furlong' expected = UNKNOWN_TIME_UNIT actual = get_time_unit(unit_name) @assertEqual(expected, actual, 'Mismatch for ' // unit_name) end subroutine test_get_time_unit