@@ -17,6 +17,8 @@ module string_test_m
1717#if ! HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY
1818 ,diagnosis_function_i &
1919#endif
20+ ,operator (.equalsExpected.) &
21+ ,operator (.also.) &
2022 ,operator (.cat.) &
2123 ,operator (.csv.) &
2224 ,operator (.sv.)
@@ -209,32 +211,22 @@ function extracts_character_value() result(test_diagnosis)
209211 type (test_diagnosis_t) test_diagnosis
210212
211213 associate(line = > string_t(' "foo" : "bar"' ), line_with_comma = > string_t(' "foo" : "bar",' ))
212- associate(json_values = > [ &
213- line% get_json_value(key= " foo" , mold= " " ) &
214- ,line% get_json_value(key= string_t(" foo" ), mold= " " ) &
215- ,line_with_comma% get_json_value(key= " foo" , mold= " " ) &
216- ,line_with_comma% get_json_value(key= string_t(" foo" ), mold= " " ) &
217- ])
218- test_diagnosis = test_diagnosis_t( &
219- test_passed = all (json_values == " bar" ) &
220- ,diagnostics_string = " expected bar; actual " // .csv. json_values &
221- )
222- end associate
214+ test_diagnosis = (line% get_json_value( key= " foo" , mold= " " ) .equalsExpected. " bar" ) &
215+ .also. (line_with_comma% get_json_value(key= " foo" , mold= " " ) .equalsExpected. " bar" ) &
216+ .also. (line% get_json_value( key= string_t(" foo" ), mold= " " ) .equalsExpected. " bar" ) &
217+ .also. (line_with_comma% get_json_value(key= string_t(" foo" ), mold= " " ) .equalsExpected. " bar" )
223218 end associate
224219 end function
225220
226221 function extracts_string_value () result(test_diagnosis)
227222 type (test_diagnosis_t) test_diagnosis
228223
229- associate(line = > string_t(' "foo" : "bar"' ))
230- associate(json_value = > line% get_json_value(key= string_t(" foo" ), mold= string_t(" " )))
231- test_diagnosis = test_diagnosis_t( &
232- test_passed = json_value == " bar" , &
233- diagnostics_string = " expected 'bar', actual " // json_value &
234- )
235- end associate
224+ associate(line = > string_t(' "foo" : "bar"' ), line_with_comma = > string_t(' "foo" : "bar",' ))
225+ test_diagnosis = (line% get_json_value( key= " foo" , mold= string_t(" " )) .equalsExpected. " bar" ) &
226+ .also. (line_with_comma% get_json_value(key= " foo" , mold= string_t(" " )) .equalsExpected. " bar" ) &
227+ .also. (line% get_json_value( key= string_t(" foo" ), mold= string_t(" " )) .equalsExpected. " bar" ) &
228+ .also. (line_with_comma% get_json_value(key= string_t(" foo" ), mold= string_t(" " )) .equalsExpected. " bar" )
236229 end associate
237-
238230 end function
239231
240232 function extracts_integer_value () result(test_diagnosis)
0 commit comments