From 9f6c10336809f1de5a1007a67dd1e8dfec4f7422 Mon Sep 17 00:00:00 2001 From: schillic Date: Wed, 11 Jul 2018 18:15:35 +0200 Subject: [PATCH] add unit test --- test/unit_Polygon.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit_Polygon.jl b/test/unit_Polygon.jl index e166d0b2f3..5be4102c8b 100644 --- a/test/unit_Polygon.jl +++ b/test/unit_Polygon.jl @@ -42,17 +42,22 @@ for N in [Float64, Float32, Rational{Int}] # Test Dimension @test dim(p) == 2 - # Test Support Vector + # test support vector, with linear and binary search d = N[1., 0.] @test σ(d, p) == N[4., 2.] + @test σ(d, p, linear_search=true) == σ(d, p, linear_search=false) d = N[0., 1.] @test σ(d, p) == N[2., 4.] + @test σ(d, p, linear_search=true) == σ(d, p, linear_search=false) d = N[-1., 0.] @test σ(d, p) == N[-1., 1.] + @test σ(d, p, linear_search=true) == σ(d, p, linear_search=false) d = N[0., -1.] @test σ(d, p) == N[0., 0.] + @test σ(d, p, linear_search=true) == σ(d, p, linear_search=false) d = N[1., -1.] @test σ(d, p) == N[4., 2.] + @test σ(d, p, linear_search=true) == σ(d, p, linear_search=false) # Test containment @test ∈(N[0., 0.], p)