/
models.jl
29 lines (28 loc) · 972 Bytes
/
models.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Base.Test
using MIPVerify: UnrestrictedPerturbationFamily, BlurringPerturbationFamily, LInfNormBoundedPerturbationFamily
@testset "models.jl" begin
@testset "UnrestrictedPerturbationFamily" begin
@testset "Base.show" begin
p = UnrestrictedPerturbationFamily()
io = IOBuffer()
Base.show(io, p)
@test String(take!(io)) == "unrestricted"
end
end
@testset "BlurringPerturbationFamily" begin
@testset "Base.show" begin
p = BlurringPerturbationFamily((5,5))
io = IOBuffer()
Base.show(io, p)
@test String(take!(io)) == "blur-(5,5)"
end
end
@testset "LInfNormBoundedPerturbationFamily" begin
@testset "Base.show" begin
p = LInfNormBoundedPerturbationFamily(0.1)
io = IOBuffer()
Base.show(io, p)
@test String(take!(io)) == "linf-norm-bounded-0.1"
end
end
end