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
*`.isAtLeast.` and `.isAtMost.` can alternatively be spelled `.greaterThanOrEqualTo.` and `.lessThanOrEqualTo.`, respectively;
36
+
*`.equalsExpected.` uses `==`, which implies that trailing blank spaces are ignored in character operands;
37
+
*`.isBefore.` and `.isAfter.` verify alphabetical and reverse-alphabetical order, respectively;
38
+
*`.all.` aggregates arrays of expression results, reports a consensus result, passes, and shows diagnostics only for failing tests, if any; and
39
+
*`.equalsExpected.` generates asymmetric diagnostic output for failures, denoting the left- and right-hand sides as the actual value and expected values, respectively.
34
40
35
-
where `.isAtLeast.` and `.isAtMost.` can alternatively be spelled
36
-
`.greaterThanOrEqualTo.` and `.lessThanOrEqualTo.`, respectively;
37
-
`.equalsExpected.` uses `==`, which implies that trailing blank spaces
38
-
are ignored in character operands; and `.isBefore.` and `.isAfter.`
39
-
verify alphabetical and reverse-alphabetical order, respectively.
40
-
The new `.all.` operator is synonymous with the `.and.` defined operation
41
-
but avoids confusion with the intrinsic `.and.` operator.
42
41
43
42
Expressive idioms
44
43
-----------------
45
44
### Assertions
46
-
Any of the above tabulated expressions can be the actual argument in an
47
-
invocation of Julienne's `call_assert` function-line preprocessor macro:
48
-
```
49
-
call_assert(x .lessThan. y)
45
+
Any of the above expressions can be the actual argument in an invocation
46
+
of Julienne's `call_julienne_assert` function-line preprocessor macro:
47
+
```fortran
48
+
call_julienne_assert(x .lessThan. y)
50
49
```
51
50
which a preprocessor will replace with a call to Julienne's assertion subroutine
52
51
when compiling with `-DASSERTIONS`. Otherwise, the preprocessor will remove the
@@ -103,7 +102,7 @@ Example expression | Result
103
102
104
103
One can use such expressions to craft a diagnostic message when constructing
105
104
a custom test function result:
106
-
```
105
+
```fortran
107
106
type(test_diagnosis_t) test_diagnosis
108
107
test_diagnosis = test_diagnosis_t( &
109
108
test_passed = i==j, &
@@ -122,7 +121,7 @@ or two procedures. The resulting `file_t` object can be manipulated elsewhere
122
121
without incurring the costs associated with file I/O. For example, the following
123
122
line reads a file named `data.txt` into a `file_t` object and associates the name
124
123
`file` with the resulting object.
125
-
```
124
+
```fortran
126
125
type(file_t) file
127
126
associate(file => file_t("data.txt"))
128
127
end associate
@@ -155,6 +154,10 @@ diagnostic messages during error termination.
155
154
156
155
Getting Started
157
156
---------------
157
+
### Writing Unit Tests
158
+
Please see [demo/README.md](./demo/README.md) for a detailed demonstration of
159
+
test setup.
160
+
158
161
### Writing Assertions
159
162
To write a Julienne assertion, insert a function-like preprocessor macro
160
163
`call_julienne_assert` on a single line as in each of the two macro
@@ -185,46 +188,6 @@ also inserts the file and line number into the stop code using via the `__FILE__
185
188
and `__LINE__` macros, respectively. Most compilers write the resulting stop code
186
189
to `error_unit`.
187
190
188
-
### Writing Unit Tests
189
-
Writing tests using Julienne involves constructing a test-description array,
190
-
in which each element is a `test_description_t` constructor function invocation
191
-
with two arguments: a `character` string describing what the test does and the
192
-
name of a function that performs the test. An example follows:
0 commit comments