Skip to content

Commit 4a3d2ba

Browse files
authored
fix tests for Julia 1.12+ (#383)
1 parent 6b47b7f commit 4a3d2ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/misc.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,21 @@ end
5050
rootfile = UnROOT.samplefile("NanoAODv5_sample.root")
5151
t = LazyTree(rootfile, "Events", "nMuon")
5252
@test t[2] == t[CartesianIndex(2)]
53+
# need two separate functions so compiler doesn't optimize away
5354
testf(evt) = evt.nMuon == 4
5455
testf2(evt) = evt.nMuon == 4
5556
# precompile
5657
testf.(t)
5758
testf2.(t)
5859
findall(@. testf(t) & testf2(t))
5960
##########
61+
a1 = testf.(t)
6062
alloc1 = @allocated a1 = testf.(t)
63+
a2 = testf2.(t)
6164
alloc1 += @allocated a2 = testf2.(t)
65+
idx1 = findall(a1 .& a2)
6266
alloc1 += @allocated idx1 = findall(a1 .& a2)
67+
idx2 = findall(@. testf(t) & testf2(t))
6368
alloc2 = @allocated idx2 = findall(@. testf(t) & testf2(t))
6469
@assert !isempty(idx1)
6570
@test idx1 == idx2

0 commit comments

Comments
 (0)