subroutine test_is_valid_day() character(len=*), parameter :: FMT = '("day (",i4,", ",i2,", ",i2,")",a)' character(len=*), parameter :: SHOULD = ' should be valid.' character(len=*), parameter :: SHOULD_NOT = ' should not be valid.' character(len=255) :: error_message integer :: d, m, y d = 30; m = 4; y = 2023 write(error_message, fmt=FMT) y, m, d, SHOULD @assertTrue(is_valid_day(y, m, d), trim(error_message)) d = 31 write(error_message, fmt=FMT) y, m, d, SHOULD_NOT @assertFalse(is_valid_day(y, m, d), trim(error_message)) d = 29 write(error_message, fmt=FMT) y, m, d, SHOULD @assertTrue(is_valid_day(y, m, d), trim(error_message)) m = 2 write(error_message, fmt=FMT) y, m, d, SHOULD_NOT @assertFalse(is_valid_day(y, m, d), trim(error_message)) y = 2024 write(error_message, fmt=FMT) y, m, d, SHOULD @assertTrue(is_valid_day(y, m, d), trim(error_message)) end subroutine test_is_valid_day