Skip to content

Commit 0800b2c

Browse files
committed
rename TestsetExpr.results -> TestsetExpr.pastresults
To differentiate from the `ReTestSet.results` field.
1 parent c05a2a5 commit 0800b2c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/ReTest.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mutable struct TestsetExpr
6969
parent::Maybe{TestsetExpr}
7070
children::Vector{TestsetExpr}
7171
strings::Vector{Union{String,Missing}}
72-
results::Dict{String,Bool}
72+
pastresults::Dict{String,Bool}
7373
# loopvalues & loopiters: when successful in evaluating loop values in resolve!,
7474
# we "flatten" the nested for loops into a single loop, with loopvalues
7575
# containing tuples of values, and loopiters the tuples of variables to which the
@@ -418,7 +418,7 @@ function make_ts(ts::TestsetExpr, pat::Pattern, stats, chan)
418418
if ts.loops === nothing
419419
quote
420420
@testset $(ts.mod) $(isfinal(ts)) $pat $(ts.id) $(ts.desc) $(ts.options) #=
421-
=# $(ts.results) $stats $chan $body
421+
=# $(ts.pastresults) $stats $chan $body
422422
end
423423
else
424424
c = count(x -> x === nothing, (ts.loopvalues, ts.loopiters))
@@ -430,7 +430,7 @@ function make_ts(ts::TestsetExpr, pat::Pattern, stats, chan)
430430
end
431431
quote
432432
@testset $(ts.mod) $(isfinal(ts)) $pat $(ts.id) $(ts.desc) $(ts.options) #=
433-
=# $(ts.results) $stats $chan $loops $body
433+
=# $(ts.pastresults) $stats $chan $loops $body
434434
end
435435
end
436436
end
@@ -1349,7 +1349,7 @@ function dryrun(mod::Module, ts::TestsetExpr, pat::Pattern, align::Int=0, parent
13491349
end
13501350
end
13511351

1352-
res = get(ts.results, subject, nothing)
1352+
res = get(ts.pastresults, subject, nothing)
13531353
if show
13541354
if maxidw > 0 # width (ndigits) of max id; <= 0 means ids not printed
13551355
printstyled(lpad(ts.id, maxidw), "| ", color = :light_black, bold=true)
@@ -1437,7 +1437,7 @@ function dryrun(mod::Module, ts::TestsetExpr, pat::Pattern, align::Int=0, parent
14371437
ts.parent, ts.children)
14381438
beginend.run = true
14391439
beginend.id = ts.id
1440-
beginend.results = ts.results
1440+
beginend.pastresults = ts.pastresults
14411441
dryrun(mod, beginend, pat, align, parentsubj; evaldesc=false,
14421442
repeated=repeated, maxidw=maxidw, marks=marks, show=show)
14431443
end

src/testset.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,22 +468,22 @@ end
468468

469469
# non-inline testset with regex filtering support
470470
macro testset(mod::Module, isfinal::Bool, pat::Pattern, id::Int64, desc::Union{String,Expr},
471-
options, results::Dict, stats::Bool, chan, body)
471+
options, pastresults::Dict, stats::Bool, chan, body)
472472
Testset.testset_beginend(mod, isfinal, pat, id, desc,
473-
options, results, stats, chan, body, __source__)
473+
options, pastresults, stats, chan, body, __source__)
474474
end
475475

476476
macro testset(mod::Module, isfinal::Bool, pat::Pattern, id::Int64, desc::Union{String,Expr},
477-
options, results::Dict, stats::Bool, chan, loops, body)
477+
options, pastresults::Dict, stats::Bool, chan, loops, body)
478478
Testset.testset_forloop(mod, isfinal, pat, id, desc,
479-
options, results, stats, chan, loops, body, __source__)
479+
options, pastresults, stats, chan, loops, body, __source__)
480480
end
481481

482482
"""
483483
Generate the code for a `@testset` with a `begin`/`end` argument
484484
"""
485485
function testset_beginend(mod::Module, isfinal::Bool, pat::Pattern, id::Int64, desc, options,
486-
results::Dict, stats::Bool, chan, tests, source)
486+
pastresults::Dict, stats::Bool, chan, tests, source)
487487
# Generate a block of code that initializes a new testset, adds
488488
# it to the task local storage, evaluates the test(s), before
489489
# finally removing the testset and giving it a chance to take
@@ -521,7 +521,7 @@ function testset_beginend(mod::Module, isfinal::Bool, pat::Pattern, id::Int64, d
521521
Base.catch_stack(), $(QuoteNode(source))))
522522
finally
523523
copy!(RNG, oldrng)
524-
$results[ts.subject] = !anyfailed(ts)
524+
$pastresults[ts.subject] = !anyfailed(ts)
525525
pop_testset()
526526
ret = finish(ts, $chan)
527527
end
@@ -541,7 +541,7 @@ end
541541
Generate the code for a `@testset` with a `for` loop argument
542542
"""
543543
function testset_forloop(mod::Module, isfinal::Bool, pat::Pattern, id::Int64,
544-
desc::Union{String,Expr}, options, results::Dict, stats, chan,
544+
desc::Union{String,Expr}, options, pastresults::Dict, stats, chan,
545545
loops, tests, source)
546546

547547
desc = esc(desc)
@@ -568,13 +568,13 @@ function testset_forloop(mod::Module, isfinal::Bool, pat::Pattern, id::Int64,
568568
let
569569
ts.timed = @stats $stats $(esc(tests))
570570
end
571-
$results[ts.subject] = !anyfailed(ts)
571+
$pastresults[ts.subject] = !anyfailed(ts)
572572
catch err
573573
err isa InterruptException && rethrow()
574574
# Something in the test block threw an error. Count that as an
575575
# error in this test set
576576
record(ts, Error(:nontest_error, Expr(:tuple), err, Base.catch_stack(), $(QuoteNode(source))))
577-
$results[ts.subject] = false
577+
$pastresults[ts.subject] = false
578578
end
579579
end
580580
end

0 commit comments

Comments
 (0)