summaryrefslogtreecommitdiffstats
path: root/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.py
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.py')
-rw-r--r--third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.py b/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.py
new file mode 100644
index 0000000000..a40e2af6ec
--- /dev/null
+++ b/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.py
@@ -0,0 +1,10 @@
+from geometry import *
+
+ln1 = Line(Point(0,0), Point(1,2))
+ln2 = Line(Point(1,1), Point(2,2))
+
+assert gradient(ln1) == 2
+assert gradient(ln2) == 1
+
+assert intersection(ln1, ln2) == Point(0, 0)
+assert intersection(ln1, ln1) is None