@@ -247,53 +247,54 @@ function check_call(e::Expr, tsargs)
247
247
end
248
248
249
249
function final_check_block (namestr, run_input, gen_input, tsargs)
250
- ts = gensym ()
251
- sr = gensym ()
250
+ @gensym (ts, sr, report, previous_failure, got_res, got_err, got_score,
251
+ res, choices, n_tc, obj, exc, trace, len, err, fail,
252
+ pass, score)
252
253
253
254
return quote
254
255
# need this for backwards compatibility
255
256
$ sr = $ SuppositionReport
256
257
$ Test. @testset $ sr $ (tsargs... ) $ namestr begin
257
- report = $ Test. get_testset ()
258
- previous_failure = $ retrieve (report. database, $ record_name (report))
259
- $ ts = $ TestState (report. config, $ run_input, previous_failure)
258
+ $ report = $ Test. get_testset ()
259
+ $ previous_failure = $ retrieve ($ report. database, $ record_name ($ report))
260
+ $ ts = $ TestState ($ report. config, $ run_input, $ previous_failure)
260
261
$ Supposition. run ($ ts)
261
- $ Test. record (report, $ ts)
262
- got_res = ! isnothing ($ ts. result)
263
- got_err = ! isnothing ($ ts. target_err)
264
- got_score = ! isnothing ($ ts. best_scoring)
265
- @debug " Any result?" Res= got_res Err= got_err Score= got_score
266
- if got_res | got_err | got_score
267
- res = @something $ ts. target_err $ ts. best_scoring $ ts. result
268
- choices = if got_err | got_score
269
- last (res)
262
+ $ Test. record ($ report, $ ts)
263
+ $ got_res = ! isnothing ($ ts. result)
264
+ $ got_err = ! isnothing ($ ts. target_err)
265
+ $ got_score = ! isnothing ($ ts. best_scoring)
266
+ $ Logging . @debug " Any result?" Res= $ got_res Err= $ got_err Score= $ got_score
267
+ if $ got_res | $ got_err | $ got_score
268
+ $ res = $ Base . @something $ ts. target_err $ ts. best_scoring $ ts. result
269
+ $ choices = if $ got_err | $ got_score
270
+ $ last ($ res)
270
271
else
271
- res
272
+ $ res
272
273
end
273
- n_tc = $ Supposition. for_choices (choices, copy ($ ts. rng))
274
- obj = $ ScopedValues. @with $ Supposition. CURRENT_TESTCASE => n_tc begin
275
- $ gen_input (n_tc)
274
+ $ n_tc = $ Supposition. for_choices ($ choices, $ copy ($ ts. rng))
275
+ $ obj = $ ScopedValues. @with $ Supposition. CURRENT_TESTCASE => $ n_tc begin
276
+ $ gen_input ($ n_tc)
276
277
end
277
- @debug " Recording result in testset"
278
- if got_err
278
+ $ Logging . @debug " Recording result in testset"
279
+ if $ got_err
279
280
# This is an unexpected error, report as `Error`
280
- exc, trace, len = res
281
- err = $ Error (obj, exc, trace[begin : len- 2 ])
282
- $ Test. record (report, err)
283
- elseif got_res # res
281
+ $ exc, $ trace, $ len = $ res
282
+ $ err = $ Error ($ obj, $ exc, $ trace[begin : $ len- 2 ])
283
+ $ Test. record ($ report, $ err)
284
+ elseif $ got_res # res
284
285
# This is an unexpected failure, report as `Fail`
285
- fail = $ Fail (obj, nothing )
286
- $ Test. record (report, fail)
287
- elseif got_score
286
+ $ fail = $ Fail ($ obj, $ nothing )
287
+ $ Test. record ($ report, $ fail)
288
+ elseif $ got_score
288
289
# This means we didn't actually get a result, so report as `Pass`
289
290
# Also mark this, so we can display this correctly during `finish`
290
- score = first (res)
291
- pass = $ Pass (Some (obj), Some (score))
292
- $ Test. record (report, pass)
291
+ $ score = $ first ($ res)
292
+ $ pass = $ Pass ($ Some ($ obj), $ Some ($ score))
293
+ $ Test. record ($ report, $ pass)
293
294
end
294
295
else
295
- pass = $ Supposition. Pass (nothing , nothing )
296
- $ Test. record (report, pass)
296
+ $ pass = $ Supposition. Pass ($ nothing , $ nothing )
297
+ $ Test. record ($ report, $ pass)
297
298
end
298
299
end
299
300
end
0 commit comments