11module string_test_m
2- use sourcery_m, only : test_t, test_result_t, string_t
2+ use sourcery_m, only : test_t, test_result_t, string_t, operator (.cat.)
33 implicit none
44
55 private
@@ -23,19 +23,20 @@ function results() result(test_results)
2323
2424 test_results = [ &
2525 test_result_t(" is_allocated() result .true. if & only if the string_t component(s) is/are allocated" , check_allocation()), &
26- test_result_t(" extracting a key string from a colon-separated key/value pair" , extracts_key()), &
27- test_result_t(" extracting a real value from a colon-separated key/value pair" , extracts_real_value()), &
28- test_result_t(" extracting a string value from a colon-separated key/value pair" , extracts_string_value()), &
29- test_result_t(" extracting a logical value from a colon-separated key/value pair" , extracts_logical_value()), &
30- test_result_t(" extracting an integer array value from a colon-separated key/value pair" , extracts_integer_array_value()), &
31- test_result_t(" extracting an integer value from a colon-separated key/value pair" , extracts_integer_value()), &
3226 test_result_t(' supporting operator(==) for string_t and character operands' , supports_equivalence_operator()), &
3327 test_result_t(' supporting operator(/=) for string_t and character operands' , supports_non_equivalence_operator()), &
28+ test_result_t(' supporting operator(//) for string_t and character operands' , supports_concatenation_operator()), &
3429 test_result_t(' assigning a string_t object to a character variable' , assigns_string_t_to_character()), &
3530 test_result_t(' assigning a character variable to a string_t object' , assigns_character_to_string_t()), &
36- test_result_t(' supporting operator(//) for string_t and character operands' , supports_concatenation_operator()), &
3731 test_result_t(' constructing from a default integer' , constructs_from_default_integer()), &
3832 test_result_t(' constructing from a real value' , constructs_from_real()), &
33+ test_result_t(' supporting unary operator(.cat.) for array arguments' , concatenates_elements()), &
34+ test_result_t(" extracting a key string from a colon-separated key/value pair" , extracts_key()), &
35+ test_result_t(" extracting a real value from a colon-separated key/value pair" , extracts_real_value()), &
36+ test_result_t(" extracting a string value from a colon-separated key/value pair" , extracts_string_value()), &
37+ test_result_t(" extracting a logical value from a colon-separated key/value pair" , extracts_logical_value()), &
38+ test_result_t(" extracting an integer array value from a colon-separated key/value pair" , extracts_integer_array_value()), &
39+ test_result_t(" extracting an integer value from a colon-separated key/value pair" , extracts_integer_value()), &
3940 test_result_t(' extracting a file base name' , extracts_file_base_name()), &
4041 test_result_t(' extracting a file name extension' , extracts_file_name_extension()) &
4142 ]
@@ -182,4 +183,11 @@ function extracts_file_name_extension() result(passed)
182183 end associate
183184 end function
184185
186+ function concatenates_elements () result(passed)
187+ logical passed
188+ associate(elements = > [string_t(" foo" ), string_t(" bar" )])
189+ passed = .cat. elements == " foobar"
190+ end associate
191+ end function
192+
185193end module string_test_m
0 commit comments