From dfb6b6b80085fb0607d9dbd710c4e61b782bf640 Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Sat, 23 Nov 2024 19:27:03 -0600 Subject: [PATCH] Fix and test summarize being broken for tuples of length other than 2 due to typo (#136) --- src/statistics.jl | 2 +- test/runtests.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/statistics.jl b/src/statistics.jl index 867ac85f..7d24681f 100644 --- a/src/statistics.jl +++ b/src/statistics.jl @@ -22,5 +22,5 @@ median(b::Benchmark) = elementwise(median, b) mean(b::Benchmark) = elementwise(mean, b) Base.maximum(b::Benchmark) = elementwise(maximum, b) -summarize(b::Tuple{<:Any, Benchmark}) = summarize.(b) +summarize(b::NTuple{<:Any, Benchmark}) = summarize.(b) summarize(b::Benchmark) = minimum(b) diff --git a/test/runtests.jl b/test/runtests.jl index 6a1b9aea..947c306a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -238,6 +238,9 @@ using Random: rand! g(x) = (@assert !issorted(x); push!(glog, hash(x)); sort!(x; alg=InsertionSort)) @b rand!(a),copyto!(b,a) f(_[1]),g(_[2]) (@assert issorted(_::Vector{Int})) evals=1 @test flog == glog + + # More than two test functions + @b 1,2,3 end @testset "display" begin