Skip to content

Commit febf545

Browse files
committed
Affine tests
1 parent 13658b3 commit febf545

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/runtests.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@ end
9999
@test logdensity(Dirac(0.3), 0.4) == -Inf
100100
end
101101

102+
@testset "AffineTransform" begin
103+
f = AffineTransform((μ=3=2))
104+
@test f(inv(f)(1)) == 1
105+
@test inv(f)(f(1)) == 1
106+
107+
g = AffineTransform((μ=3=2))
108+
@test g(inv(g)(1)) == 1
109+
@test inv(g)(g(1)) == 1
110+
end
111+
112+
@testset "Affine" begin
113+
unif = (x -> 0<x<1, Lebesgue(ℝ))
114+
f = AffineTransform((μ=3=2))
115+
g = AffineTransform((μ=3=2))
116+
117+
@test Affine((μ=3=2))(unif) == Affine(f, unif)
118+
@test Affine((μ=3=2))(unif) == Affine(g, unif)
119+
@test_broken logdensity(Affine(f, Affine(inv(f), unif)), 0.5) == 1
120+
end
121+
102122
# @testset "For" begin
103123
# FORDISTS = [
104124
# For(1:10) do j Normal(μ=j) end

0 commit comments

Comments
 (0)