about summary refs log blame commit diff
path: root/tvix/eval/builtin-macros/tests/tests.rs
blob: 8f3e83b672efc9150ed871dc19f7a32f5cca679f (plain) (tree)

























                                                                                        
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);
}