Test Point/Size/Rectangle tostring

This commit is contained in:
David Capello 2019-03-29 15:54:50 -03:00
parent a32a0485c7
commit 7a1cd9dad7
3 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,7 @@ assert(pt.y == 0)
pt = Point(1, 2)
assert(pt.x == 1)
assert(pt.y == 2)
assert("Point{ x=1, y=2 }" == tostring(pt))
local pt2 = Point(pt)
assert(pt2.x == 1)

View File

@ -16,6 +16,7 @@ assert(rc.y == 2)
assert(rc.width == 3)
assert(rc.height == 4)
assert(not rc.isEmpty)
assert("Rectangle{ x=1, y=2, width=3, height=4 }" == tostring(rc))
local rc2 = Rectangle(rc)
assert(rc2.x == 1)

View File

@ -10,6 +10,7 @@ assert(sz.height == 0)
sz = Size(3, 4)
assert(sz.width == 3)
assert(sz.height == 4)
assert("Size{ width=3, height=4 }" == tostring(sz))
local sz2 = Size(sz)
assert(sz2.width == 3)