|
197 | 197 | # (test:expect (return_true) "return true"}) |
198 | 198 | # =end |
199 | 199 | # @author https://github.com/SuperFola |
200 | | -(macro test:expect (_cond ..._desc) { |
| 200 | +(macro test:expect (_cond ..._desc) {{ |
201 | 201 | (mut _cond_res ($as-is _cond)) |
202 | 202 | (if (!= true _cond_res) |
203 | 203 | (testing:_report_error true _cond_res "true" ($repr _cond) _desc) |
204 | | - (testing:_report_success)) }) |
| 204 | + (testing:_report_success)) }}) |
205 | 205 |
|
206 | 206 | # @brief Compare two values that should be equal and generate a test case |
207 | 207 | # @param _expr computed value to test |
|
213 | 213 | # (test:eq 5 (foo) "foo should return 5")}) |
214 | 214 | # =end |
215 | 215 | # @author https://github.com/SuperFola |
216 | | -(macro test:eq (_expr _expected ..._desc) { |
| 216 | +(macro test:eq (_expr _expected ..._desc) {{ |
217 | 217 | (mut _expected_res ($as-is _expected)) |
218 | 218 | (mut _expr_res ($as-is _expr)) |
219 | 219 | (if (= _expected_res _expr_res) |
220 | 220 | (testing:_report_success) |
221 | | - (testing:_report_error _expected_res _expr_res ($repr _expected) ($repr _expr) _desc)) }) |
| 221 | + (testing:_report_error _expected_res _expr_res ($repr _expected) ($repr _expr) _desc)) }}) |
222 | 222 |
|
223 | 223 | # @brief Compare two values that should **not** be equal and generate a test case |
224 | 224 | # @param _value tested value |
|
229 | 229 | # (test:neq 0 (my_function 1 2 3))}) |
230 | 230 | # =end |
231 | 231 | # @author https://github.com/SuperFola |
232 | | -(macro test:neq (_value _unexpected ..._desc) { |
| 232 | +(macro test:neq (_value _unexpected ..._desc) {{ |
233 | 233 | (mut _unexpected_res ($as-is _unexpected)) |
234 | 234 | (mut _value_res ($as-is _value)) |
235 | 235 | (if (!= _unexpected_res _value_res) |
236 | 236 | (testing:_report_success) |
237 | | - (testing:_report_error _unexpected_res _value_res ($repr _unexpected) ($repr _value) _desc)) }) |
| 237 | + (testing:_report_error _unexpected_res _value_res ($repr _unexpected) ($repr _value) _desc)) }}) |
238 | 238 |
|
239 | 239 | # @brief Generate the code for a test suite |
240 | 240 | # @details Create two variables: _name-output (a list: [successes, failures]) and _name-status (boolean, true on success) |
|
0 commit comments