Skip to content

Commit 71da64c

Browse files
committed
added empty string/pattern test cases, corrected test_slice to test_slice_string
1 parent 87e2547 commit 71da64c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tests/string/test_string_functions.f90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ subroutine test_reverse_string
5656

5757
end subroutine test_reverse_string
5858

59-
subroutine test_slice
59+
subroutine test_slice_string
6060
type(string_type) :: test_string
6161
test_string = "abcdefghijklmnopqrstuvwxyz"
6262

@@ -160,7 +160,7 @@ subroutine test_slice
160160
call check(slice(test_string) == "", &
161161
"Slice, Empty string: no arguments provided")
162162

163-
end subroutine test_slice
163+
end subroutine test_slice_string
164164

165165
subroutine test_find
166166
type(string_type) :: test_string, test_pattern
@@ -172,6 +172,9 @@ subroutine test_find
172172
call check(find("qwqwqwqwqwqwqw", test_pattern) == 1)
173173
call check(find(test_string, "qwq", 2) == 3)
174174
call check(find("qwqwqwqwqwqwqw", "qwq", 2, .false.) == 5)
175+
call check(find("", "") == 0)
176+
call check(find("", test_pattern) == 0)
177+
call check(find(test_string, "") == 0)
175178

176179
end subroutine test_find
177180

0 commit comments

Comments
 (0)