diff --git a/src/root/offline.jl b/src/root/offline.jl index 856e94c1250c5073ff0d2a440fddda6c93ba3150..9edfbb23c4f779163aefed43c20df70720532654 100644 --- a/src/root/offline.jl +++ b/src/root/offline.jl @@ -49,7 +49,7 @@ Base.firstindex(::FitInformation) = 0 Base.lastindex(fitinf::FitInformation) = length(fitinf) - 1 Base.eltype(::FitInformation) = Float64 function Base.iterate(fitinf::FitInformation, state=0) - state > length(fitinf) ? nothing : (fitinf[state], state+1) + state > length(fitinf)+1 ? nothing : (fitinf[state], state+1) end """ diff --git a/test/tools.jl b/test/tools.jl index 09d884a1373a6d22cea79381cabb537ca08d3f63..6cb5b7fef7cd13c3ca7b3ca4f6300e2632d082f9 100644 --- a/test/tools.jl +++ b/test/tools.jl @@ -91,7 +91,8 @@ const ONLINEFILE = datapath("online", "km3net_online.root") @test 56 == length(t[1].trks) @test 0 == length(t[1].w) @test 17 == length(t[1].trks[1].fitinf) - @test 0.009290906625313346 == t[end].trks[1].fitinf[0] + @test 63.92088448672399 == sum(t[end].trks[2].fitinf) + @test 101.0 == t[1].trks[1].fitinf[end] close(f) f = ROOTFile(datapath("offline", "numucc.root"))