diff options
Diffstat (limited to 'toolkit/components/uniffi-fixtures/sprites/tests/bindings/test_sprites.py')
-rw-r--r-- | toolkit/components/uniffi-fixtures/sprites/tests/bindings/test_sprites.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toolkit/components/uniffi-fixtures/sprites/tests/bindings/test_sprites.py b/toolkit/components/uniffi-fixtures/sprites/tests/bindings/test_sprites.py new file mode 100644 index 0000000000..1e91997001 --- /dev/null +++ b/toolkit/components/uniffi-fixtures/sprites/tests/bindings/test_sprites.py @@ -0,0 +1,16 @@ +from sprites import Point, Sprite, Vector + +sempty = Sprite(None) +assert sempty.get_position() == Point(x=0, y=0) + +s = Sprite(Point(x=0, y=1)) +assert s.get_position() == Point(x=0, y=1) + +s.move_to(Point(x=1, y=2)) +assert s.get_position() == Point(x=1, y=2) + +s.move_by(Vector(dx=-4, dy=2)) +assert s.get_position() == Point(x=-3, y=4) + +srel = Sprite.new_relative_to(Point(x=0, y=1), Vector(dx=1, dy=1.5)) +assert srel.get_position() == Point(x=1, y=2.5) |