rust_twostack 0.15.0

Support for two-dimentional stacks for the Rust programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(test)]
mod tests {
    #![allow(unused_imports)]
    use super::*;
    use rust_twostack::ts::{TS, StackOp};
    use rust_dynamic::value::Value;
    use rust_dynamic::ctx::Context;
    use rust_dynamic::ctx::NullContext;

    #[test]
    fn test_ts_eval_val() {
        let mut ts = TS::new();
        let ctx = NullContext::new();
        let fun = ctx.resolve("test").expect("function expected").f;
        let _ = ts.eval(&ctx, "test", fun, Value::from_int(42), StackOp::None).unwrap();
        assert_eq!(ts.stack_len(), 0);
    }
}