mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
remove old declarative macros
This commit is contained in:
parent
bcbcc387a2
commit
b7bb6119aa
9 changed files with 33 additions and 408 deletions
|
|
@ -116,16 +116,18 @@ mod dsl_macros;
|
|||
|
||||
#[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));
|
||||
#[tengri_proc::expose]
|
||||
impl Test {
|
||||
fn some_bool (&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
assert_eq!(Test.get(&Value::Sym(":false")), Some(false));
|
||||
assert_eq!(Test.get(&Value::Sym(":true")), Some(true));
|
||||
assert_eq!(Test.get(&Value::Sym(":some-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> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue