Skip to content

Commit

Permalink
test(refactor): simplify test for rand
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrais committed Jan 25, 2024
1 parent 0131153 commit 6422593
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/distributions/distributions_setuptests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function run_test_basic_functions(distribution; nsamples = 10, test_gradients =
@test @inferred(mean(ef)) mean(distribution)
@test @inferred(var(ef)) var(distribution)
@test @inferred(std(ef)) std(distribution)
@test size(ExponentialFamily.check_logpdf(variate_form(typeof(ef)), typeof(x), eltype(x), ef, rand(ef, 10))[2])[end] === 10
@test size(rand(ef, 10))[end] === 10
@test rand(StableRNG(42), ef) rand(StableRNG(42), distribution)
@test all(rand(StableRNG(42), ef, 10) .≈ rand(StableRNG(42), distribution, 10))
@test all(rand!(StableRNG(42), ef, [deepcopy(x) for _ in 1:10]) .≈ rand!(StableRNG(42), distribution, [deepcopy(x) for _ in 1:10]))
Expand Down

0 comments on commit 6422593

Please sign in to comment.