Skip to content

Commit

Permalink
Merge pull request #7 from terasakisatoshi/terasaki/barnsley-fern
Browse files Browse the repository at this point in the history
add test for BarnsleyCategoricalDistribution
  • Loading branch information
terasakisatoshi authored May 12, 2024
2 parents 79820ce + 8b218a1 commit 49f8e78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion barnsley_fern/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test

using MyCxxWrap4: Affine, transform!
using MyCxxWrap4: Affine, transform!, BarnsleyCategoricalDistribution

@testset "Affine/transform!" begin
w11 = 1.0
Expand All @@ -16,4 +16,9 @@ using MyCxxWrap4: Affine, transform!
y = Ref{Float64}(1.)
transform!(aff, x ,y)
@test (x[], y[]) == (2.0, 0.0)
end

@testset "BarnsleyCategoricalDistribution" begin
d = BarnsleyCategoricalDistribution(42);
@test [rand(d) for _ in 1:20] == Int32[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 3, 1, 1, 0, 1, 1]
end

0 comments on commit 49f8e78

Please sign in to comment.