Skip to main content

run_inspecting

Function run_inspecting 

Source
pub fn run_inspecting(source: &str, fuel: Fuel) -> Io<Error, (Value, Heap)>
Expand description

Lex, parse, and evaluate source, returning both the value and the final heap. Useful for tests that want to verify garbage-collection behaviour.

§Errors

Same as run.

§Examples

use lambda_ref_cat::eval::Fuel;
use lambda_ref_cat::run_inspecting;

let (_value, heap) = run_inspecting(r"ref (\x. x)", Fuel::new(100)).run()?;
assert_eq!(heap.len(), 1);