Skip to content

Commit 7d4aeb5

Browse files
committed
added fail messages and put fullstop (.) in documentation
1 parent 90b401c commit 7d4aeb5

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

doc/specs/stdlib_strings.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ Pure function.
233233

234234
#### Argument
235235

236-
- `string`: Character scalar or [[stdlib_string_type(module):string_type(type)]]
236+
- `string`: Character scalar or [[stdlib_string_type(module):string_type(type)]].
237237
This argument is intent(in).
238-
- `first`: integer
238+
- `first`: integer.
239239
This argument is intent(in) and optional.
240-
- `last`: integer
240+
- `last`: integer.
241241
This argument is intent(in) and optional.
242-
- `stride`: integer
242+
- `stride`: integer.
243243
This argument is intent(in) and optional.
244244

245245
#### Result value
@@ -298,13 +298,13 @@ Pure function
298298

299299
#### Argument
300300

301-
- `string`: Character scalar or [[stdlib_string_type(module):string_type(type)]]
301+
- `string`: Character scalar or [[stdlib_string_type(module):string_type(type)]].
302302
This argument is intent(in).
303-
- `pattern`: Character scalar or [[stdlib_string_type(module):string_type(type)]]
303+
- `pattern`: Character scalar or [[stdlib_string_type(module):string_type(type)]].
304304
This argument is intent(in).
305-
- `occurrence`: integer
305+
- `occurrence`: integer.
306306
This argument is intent(in) and optional.
307-
- `consider_overlapping`: logical
307+
- `consider_overlapping`: logical.
308308
This argument is intent(in) and optional.
309309

310310
#### Result value

src/tests/string/test_string_functions.f90

+18-9
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,24 @@ subroutine test_find
166166
type(string_type) :: test_string, test_pattern
167167
test_string = "qwqwqwqwqwqwqw"
168168
test_pattern = "qwq"
169-
call check(find(test_string, test_pattern, 4) == 7)
170-
call check(find(test_string, test_pattern, 3, .false.) == 9)
171-
call check(find(test_string, test_pattern, 7) == 0)
172-
call check(find("qwqwqwqwqwqwqw", test_pattern) == 1)
173-
call check(find(test_string, "qwq", 2) == 3)
174-
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)
169+
call check(find(test_string, test_pattern, 4) == 7, &
170+
& 'Find: test_string, test_pattern, 4')
171+
call check(find(test_string, test_pattern, 3, .false.) == 9, &
172+
& 'Find: test_string, test_pattern, 3')
173+
call check(find(test_string, test_pattern, 7) == 0, &
174+
& 'Find: test_string, test_pattern, 7')
175+
call check(find("qwqwqwqwqwqwqw", test_pattern) == 1, &
176+
& 'Find: "qwqwqwqwqwqwqw", test_pattern')
177+
call check(find(test_string, "qwq", 2) == 3, &
178+
&, 'Find: test_string, "qwq", 2')
179+
call check(find("qwqwqwqwqwqwqw", "qwq", 2, .false.) == 5, &
180+
& 'Find: "qwqwqwqwqwqwqw", "qwq", 2, .false.')
181+
call check(find("", "") == 0, &
182+
& 'Find: "", ""')
183+
call check(find("", test_pattern) == 0, &
184+
& 'Find: "", test_pattern')
185+
call check(find(test_string, "") == 0, &
186+
&, 'Find: test_string, ""')
178187

179188
end subroutine test_find
180189

0 commit comments

Comments
 (0)