/
models.jl
31 lines (30 loc) · 1.02 KB
/
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
30
31
using Test
using MIPVerify:
UnrestrictedPerturbationFamily, BlurringPerturbationFamily, LInfNormBoundedPerturbationFamily
@isdefined(TestHelpers) || include("TestHelpers.jl")
TestHelpers.@timed_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