You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit adds
1. operator(.withinFraction.) for real & double precision operands
2. operator(.withinPercentage.) for real & double precision operands
3. unit tests for each operator.
Copy file name to clipboardExpand all lines: test/test_diagnosis_test_m.F90
+49-22Lines changed: 49 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@ module test_diagnosis_test_m
21
21
,operator(.equalsExpected.) &
22
22
,operator(.approximates.) &
23
23
,operator(.within.) &
24
+
,operator(.withinFraction.) &
25
+
,operator(.withinPercentage.) &
24
26
,operator(.lessThan.) &
25
27
,operator(.lessThanOrEqualTo.) &
26
28
,operator(.greaterThan.) &
@@ -50,6 +52,10 @@ function results() result(test_results)
50
52
associate(descriptions => [ &
51
53
test_description_t("construction from a real expression of the form 'x .approximates. y .within. tolerance'", check_approximates_real) &
52
54
,test_description_t("construction from a double precision expression of the form 'x .approximates. y .within. tolerance'", check_approximates_double) &
55
+
,test_description_t("construction from the real expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_real_fraction) &
56
+
,test_description_t("construction from the double precision expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_double_fraction) &
57
+
,test_description_t("construction from the real expression 'x .approximates. y .withinPercentage. tolerance'", check_approximates_real_percentage) &
58
+
,test_description_t("construction from the double precision expression 'x .approximates. y .withinPercentage. tolerance'", check_approximates_double_percentage) &
53
59
,test_description_t("construction from an integer expression of the form 'i .equalsExpected. j", check_equals_integer) &
54
60
,test_description_t("construction from a real expression of the form 'x .lessThan. y", check_less_than_real) &
55
61
,test_description_t("construction from a double precision expression of the form 'x .lessThan. y", check_less_than_double) &
@@ -66,32 +72,29 @@ function results() result(test_results)
66
72
! Work around missing Fortran 2008 feature: associating a procedure actual argument with a procedure pointer dummy argument:
test_description_t("construction from a real expression of the form `x .approximates. y .within. tolerance`" , check_approximates_real_ptr) &
94
95
,test_description_t("construction from a double-precision expression of the form `x .approximates. y .within. tolerance`", check_approximates_double_ptr) &
96
+
test_description_t("construction from the real expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_real_fraction_ptr) &
97
+
,test_description_t("construction from the double precision expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_double_fraction_ptr) &
95
98
,test_description_t("construction from an integer expression of the form `i .equalsExpected. j`" , check_equals_integer_ptr) &
96
99
,test_description_t("construction from a real expression of the form 'x .lessThan. y" , check_less_than_real_ptr) &
97
100
,test_description_t("construction from a double precision expression of the form 'x .lessThan. y" , check_less_than_double_ptr) &
@@ -143,6 +146,30 @@ function check_approximates_double() result(test_diagnosis)
0 commit comments