The forgex_test_m
module provides helper procedures to unit testing for Forgex.
This function checks if a pattern is found within a string and
compares the result to the correct_answer
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
logical, | intent(in) | :: | correct_answer |
This function checks if a pattern matches exactly a string and compares the result to the correct answer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
logical, | intent(in) | :: | correct_answer |
This function checks whether the correct prefix is extracted for a given pattern.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | expected_prefix |
This function checks if a pattern matches a string using the regex
function and compares the result to the expected answer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
character(len=*), | intent(in) | :: | answer | |||
character(len=:), | intent(inout), | allocatable | :: | substr |
This function checks whether the correct suffix is extracted for a given pattern.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | expected_suffix |
This subroutine runs the is_valid__in
function and prints the result.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
logical, | intent(in) | :: | answer | |||
logical, | intent(inout) | :: | result |
This subroutine runs the is_valid__match
function and prints the result.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
logical, | intent(in) | :: | answer | |||
logical, | intent(inout) | :: | result |
This subroutine runs the is_valid_prefix
function and prints the result.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | prefix | |||
logical, | intent(inout) | :: | result |
This subroutine runs the is_valid__regex
function and prints the result.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
character(len=*), | intent(in) | :: | answer | |||
logical, | intent(inout) | :: | result |
This function runs the is_valid_suffix
function and prints the result.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | suffix | |||
logical, | intent(inout) | :: | result |