about summary refs log tree commit diff
path: root/tvix/eval/builtin-macros/tests/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/builtin-macros/tests/tests.rs')
-rw-r--r--tvix/eval/builtin-macros/tests/tests.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tvix/eval/builtin-macros/tests/tests.rs b/tvix/eval/builtin-macros/tests/tests.rs
new file mode 100644
index 000000000000..8f3e83b672ef
--- /dev/null
+++ b/tvix/eval/builtin-macros/tests/tests.rs
@@ -0,0 +1,26 @@
+use tvix_eval_builtin_macros::builtins;
+
+mod value {
+    pub use tvix_eval::Builtin;
+}
+
+#[builtins]
+mod builtins {
+    use tvix_eval::{ErrorKind, Value, VM};
+
+    #[builtin("identity")]
+    pub fn builtin_identity(_vm: &mut VM, x: Value) -> Result<Value, ErrorKind> {
+        Ok(x)
+    }
+
+    #[builtin("tryEval")]
+    pub fn builtin_try_eval(_: &mut VM, #[lazy] _x: Value) -> Result<Value, ErrorKind> {
+        todo!()
+    }
+}
+
+#[test]
+fn builtins() {
+    let builtins = builtins::builtins();
+    assert_eq!(builtins.len(), 2);
+}