dsl: InputLayerCond; collect macros

This commit is contained in:
🪞👃🪞 2025-05-03 02:13:22 +03:00
parent 0d4ba4a54e
commit 3df1938626
6 changed files with 121 additions and 110 deletions

View file

@ -114,6 +114,20 @@ mod dsl_macros;
Ok(())
}
#[cfg(test)] #[test] fn test_dsl_context () {
struct Test;
provide_bool!(bool: |self: Test|{
":provide-bool" => true
});
let test = Test;
assert_eq!(test.get(&Value::Sym(":false")), Some(false));
assert_eq!(test.get(&Value::Sym(":true")), Some(true));
assert_eq!(test.get(&Value::Sym(":provide-bool")), Some(true));
assert_eq!(test.get(&Value::Sym(":missing-bool")), None);
assert_eq!(test.get(&Value::Num(0)), Some(false));
assert_eq!(test.get(&Value::Num(1)), Some(true));
}
//#[cfg(test)] #[test] fn test_examples () -> Result<(), ParseError> {
//// Let's pretend to render some view.
//let source = include_str!("../../tek/src/view_arranger.edn");