summaryrefslogtreecommitdiffstats
path: root/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.kts
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.kts')
-rw-r--r--third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.kts10
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.kts b/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.kts
new file mode 100644
index 0000000000..77bb9932ec
--- /dev/null
+++ b/third_party/rust/uniffi-example-geometry/tests/bindings/test_geometry.kts
@@ -0,0 +1,10 @@
+import uniffi.geometry.*;
+
+val ln1 = Line(Point(0.0,0.0), Point(1.0,2.0))
+val ln2 = Line(Point(1.0,1.0), Point(2.0,2.0))
+
+assert( gradient(ln1) == 2.0 )
+assert( gradient(ln2) == 1.0 )
+
+assert( intersection(ln1, ln2) == Point(0.0, 0.0) )
+assert( intersection(ln1, ln1) == null )