Add tests for Selection.isEmpty/contains

This commit is contained in:
David Capello 2018-08-31 15:07:59 -03:00
parent ec5a4c263f
commit e7a4cce508

View File

@ -9,12 +9,18 @@ assert(a.bounds.x == 0)
assert(a.bounds.y == 0)
assert(a.bounds.width == 0)
assert(a.bounds.height == 0)
assert(a.isEmpty)
a:select(1, 2, 3, 4)
assert(a.bounds.x == 1)
assert(a.bounds.y == 2)
assert(a.bounds.width == 3)
assert(a.bounds.height == 4)
assert(not a.isEmpty)
assert(a:contains(1, 2))
assert(a:contains(1+3-1, 2+4-1))
assert(not a:contains(0, 1))
assert(not a:contains(1+3, 2+4))
a:select{x=5, y=6, width=7, height=8}
assert(a.bounds.x == 5)
@ -27,3 +33,5 @@ assert(a.bounds.x == 0)
assert(a.bounds.y == 0)
assert(a.bounds.width == 0)
assert(a.bounds.height == 0)
assert(a.isEmpty)
assert(not a:contains(0, 0))