Skip to content

Commit

Permalink
#58 - added removed doctests as unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Dec 20, 2017
1 parent 109f435 commit 095d3a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit_BallInf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ d = [-1., -1.]
@test σ(d, b) == [-2., -2.]
d = [1., -1.]
@test σ(d, b) == [2., -2.]

# membership
b = BallInf([1., 1.], 1.)
@test !([.5, -.5], b)
@test ([.5, 1.5], b)
5 changes: 5 additions & 0 deletions test/unit_Hyperrectangle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ H3 = Hyperrectangle(low=l, high=h)
H = Hyperrectangle(center=[-2.1, 5.6, 0.9], radius=fill(0.5, 3))
@test low(H) == [-2.6, 5.1, 0.4]
@test high(H) == [-1.6, 6.1, 1.4]

# membership
H = Hyperrectangle([1.0, 1.0], [2.0, 3.0])
@test !([-1.1, 4.1], H)
@test ([-1.0, 4.0], H)
5 changes: 5 additions & 0 deletions test/unit_Singleton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ d = [-1., .5]
@test σ(d, s) == [1., 2.]
d = [0., 0.]
@test σ(d, s) == [1., 2.]

# membership
S = Singleton([1., 1.])
!([0.9, 1.1], S)
([1.0, 1.0], S)

0 comments on commit 095d3a3

Please sign in to comment.