diff options
Diffstat (limited to 'city/geometry-test.lua')
| -rw-r--r-- | city/geometry-test.lua | 29 | 
1 files changed, 29 insertions, 0 deletions
| diff --git a/city/geometry-test.lua b/city/geometry-test.lua index ab3265d..3fedae6 100644 --- a/city/geometry-test.lua +++ b/city/geometry-test.lua @@ -1,6 +1,13 @@  local test = require('minunit').test  local geom = require 'geometry' + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- geom.point tests +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +  test(     'create point object',     function() @@ -22,3 +29,25 @@ test(        assert(a:distance_to(a) == 0)     end  ) + + +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- geom.square tests +-- +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +test( +   'create square object', +   function() +      local s = geom.square(geom.point(0, 0), 1) +      assert(s.center.x == 0) +      assert(s.center.y == 0) +      assert(s.span == 1) + +      assert(s.x.min == -0.5) +      assert(s.x.max ==  0.5) +      assert(s.y.min == -0.5) +      assert(s.y.max ==  0.5) +   end +) | 
