diff --git a/test/testutils.jl b/test/testutils.jl index 358eb6c95..3aef74cd2 100644 --- a/test/testutils.jl +++ b/test/testutils.jl @@ -30,7 +30,6 @@ end function test_distr(distr::DiscreteUnivariateDistribution, n::Int; testquan::Bool=true, rng::AbstractRNG=MersenneTwister(), test_scalar_rand::Bool=false) - println(" testing $(distr)") test_range(distr) vs = get_evalsamples(distr, 0.00001) @@ -73,9 +72,7 @@ end # testing the implementation of a continuous univariate distribution # function test_distr(distr::ContinuousUnivariateDistribution, n::Int; - testquan::Bool=true, rng::AbstractRNG=MersenneTwister(123), - test_scalar_rand::Bool=false) - println(" testing $(distr)") + testquan::Bool=true, rng::AbstractRNG=MersenneTwister(123)) test_range(distr) vs = get_evalsamples(distr, 0.01, 2000) @@ -116,8 +113,7 @@ function test_samples(s::Sampleable{Univariate, Discrete}, # the sampleable n::Int; # number of samples to generate q::Float64=1.0e-7, # confidence interval, 1 - q as confidence verbose::Bool=false, # show intermediate info (for debugging) - rng::Union{AbstractRNG, Missing}=missing, # add an rng? - call_scalar::Bool=false) # directly scall the scalar rand(d) instead + rng::Union{AbstractRNG, Missing}=missing) # add an rng? # The basic idea # ------------------ # Generate n samples, and count the occurrences of each value within a reasonable range. @@ -211,8 +207,8 @@ function test_samples(s::Sampleable{Univariate, Discrete}, # the sampleable end test_samples(distr::DiscreteUnivariateDistribution, n::Int; - q::Float64=1.0e-6, verbose::Bool=false, rng=missing, kwargs...) = - test_samples(distr, distr, n; q=q, verbose=verbose, rng=rng, kwargs...) + q::Float64=1.0e-6, verbose::Bool=false, rng=missing) = + test_samples(distr, distr, n; q=q, verbose=verbose, rng=rng) # for continuous samplers # @@ -222,8 +218,7 @@ function test_samples(s::Sampleable{Univariate, Continuous}, # the sampleable nbins::Int=50, # divide the main interval into nbins q::Float64=1.0e-6, # confidence interval, 1 - q as confidence verbose::Bool=false, # show intermediate info (for debugging) - rng::Union{AbstractRNG, Missing}=missing, # add an rng? - call_scalar::Bool=false) # directly scall the scalar rand(d) instead + rng::Union{AbstractRNG, Missing}=missing) # add an rng? # The basic idea # ------------------ @@ -332,8 +327,8 @@ function test_samples(s::Sampleable{Univariate, Continuous}, # the sampleable return samples end -test_samples(distr::ContinuousUnivariateDistribution, n::Int; nbins::Int=50, q::Float64=1.0e-6, verbose::Bool=false, rng=missing, kwargs...) = - test_samples(distr, distr, n; nbins=nbins, q=q, verbose=verbose, rng=rng, kwargs...) +test_samples(distr::ContinuousUnivariateDistribution, n::Int; nbins::Int=50, q::Float64=1.0e-6, verbose::Bool=false, rng=missing) = + test_samples(distr, distr, n; nbins=nbins, q=q, verbose=verbose, rng=rng) #### Testing range & support methods diff --git a/test/univariate/continuous/exponential.jl b/test/univariate/continuous/exponential.jl index e8284389a..e710dadab 100644 --- a/test/univariate/continuous/exponential.jl +++ b/test/univariate/continuous/exponential.jl @@ -19,6 +19,6 @@ test_cgf(Exponential(10 ), (0.08, -1, -100f0, -1e6)) Exponential(0.91), Exponential(10) ] - test_distr(d, 10^6, test_scalar_rand = true) + test_distr(d, 10^6) end end diff --git a/test/univariate/continuous/logitnormal.jl b/test/univariate/continuous/logitnormal.jl index b8c4a578d..9959608d3 100644 --- a/test/univariate/continuous/logitnormal.jl +++ b/test/univariate/continuous/logitnormal.jl @@ -70,6 +70,6 @@ end LogitNormal(-2, 3), LogitNormal(0, 0.2) ] - test_distr(d, 10^6, test_scalar_rand = true) + test_distr(d, 10^6) end end \ No newline at end of file diff --git a/test/univariate/continuous/lognormal.jl b/test/univariate/continuous/lognormal.jl index 26c16f773..3564d6fb8 100644 --- a/test/univariate/continuous/lognormal.jl +++ b/test/univariate/continuous/lognormal.jl @@ -325,6 +325,6 @@ end LogNormal(3.0, 1.0) LogNormal(3.0, 2.0) ] - test_distr(d, 10^6, test_scalar_rand = true) + test_distr(d, 10^6) end end \ No newline at end of file diff --git a/test/univariate/continuous/normalcanon.jl b/test/univariate/continuous/normalcanon.jl index 443d6ec49..4fc8de4da 100644 --- a/test/univariate/continuous/normalcanon.jl +++ b/test/univariate/continuous/normalcanon.jl @@ -5,6 +5,6 @@ NormalCanon(-1.0, 2.5) NormalCanon(2.0, 0.8) ] - test_distr(d, 10^6, test_scalar_rand = true) + test_distr(d, 10^6) end end \ No newline at end of file diff --git a/test/univariate/continuous/pareto.jl b/test/univariate/continuous/pareto.jl index 9e7e95775..87ef527c7 100644 --- a/test/univariate/continuous/pareto.jl +++ b/test/univariate/continuous/pareto.jl @@ -5,6 +5,6 @@ Pareto(2.0, 1.5) Pareto(3.0, 2.0) ] - test_distr(d, 10^6, test_scalar_rand = true) + test_distr(d, 10^6) end end \ No newline at end of file