branch: externals/triples
commit ac10a3cc04e9eef12e0830e8001ccfaa75e6620e
Author: Andrew Hyatt <[email protected]>
Commit: Andrew Hyatt <[email protected]>
Test the ability to store vectors
---
triples-test.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/triples-test.el b/triples-test.el
index c181b9a845..1f1fbbe541 100644
--- a/triples-test.el
+++ b/triples-test.el
@@ -296,6 +296,16 @@ easily debug into it.")
(should (equal '(:name ("Name"))
(triples-get-type db "foo" 'named)))))
+(ert-deftest triples-vector ()
+ (triples-test-with-temp-db
+ (triples-add-schema db 'named 'name)
+ (triples-add-schema db 'embedding '(embedding :base/unique t :base/type
vector))
+ (triples-set-type db "foo" 'named :name '("Name"))
+ (triples-set-type db "foo" 'embedding :embedding [1 2 3 4 5])
+ (should (equal '(:embedding [1 2 3 4 5])
+ (triples-get-type db "foo" 'embedding)))
+ (should-error (triples-set-type db "foo" 'embedding :embedding '(1 2 3)))))
+
(ert-deftest triples-reversed ()
(triples-test-with-temp-db
(triples-add-schema db 'named