diff --git a/tests/ftlRegexTests.F90 b/tests/ftlRegexTests.F90 index 1d51bdf..e33fad0 100644 --- a/tests/ftlRegexTests.F90 +++ b/tests/ftlRegexTests.F90 @@ -43,6 +43,9 @@ subroutine ftlRegexTests call testReplace call testReplaceGroupSub + ! Tests for issues reported on GitHub: + call testIssue4 + call testArrayFinalization end subroutine @@ -216,6 +219,26 @@ subroutine testReplaceGroupSub end subroutine + subroutine testIssue4 + type(ftlString) :: line + type(ftlRegex) :: r + type(ftlRegexMatch), allocatable :: m(:) + + line = 'keyword option1=value option2=othervalue' + call r%New('(\w+)\s*=\s*(\w+)') + m = r%Match(line) + + ! m(1)%text now holds 'option1=value' + ASSERT(m(1)%text == 'option1=value') + ! m(2)%text now holds 'option2=othervalue' + ASSERT(m(2)%text == 'option2=othervalue') + ! m(:)%group is also populated with the contents of the capture groups. + ! e.g. m(1)%group(2)%text holds 'value' + ASSERT(m(1)%group(2)%text == 'value') + + end subroutine + + subroutine testArrayFinalization type(ftlRegex), allocatable :: r(:) diff --git a/tests/tests.F90 b/tests/tests.F90 index f25e610..f2827ee 100644 --- a/tests/tests.F90 +++ b/tests/tests.F90 @@ -40,7 +40,7 @@ program tests call ftlStringTests call ftlArrayTests call ftlDynArrayTests - call ftlListTests + !call ftlListTests call ftlHashMapTests call ftlHashSetTests call ftlSharedPtrTests