Update benchmarks and adjust tests
This commit updates benchmark values in several example files to reflect minor performance variations. It also includes adjustments to integration and unit tests to align with recent changes in the type checking and VM logic, specifically concerning closures and TCO handling.
This commit is contained in:
@@ -232,7 +232,7 @@ mod tests {
|
||||
|
||||
// Mock Registry
|
||||
struct MockRegistry {
|
||||
functions: HashMap<Address, TypedNode>,
|
||||
functions: HashMap<Address, BoundNode>,
|
||||
}
|
||||
|
||||
impl MockRegistry {
|
||||
@@ -240,13 +240,13 @@ mod tests {
|
||||
Self { functions: HashMap::new() }
|
||||
}
|
||||
|
||||
fn register(&mut self, addr: Address, node: TypedNode) {
|
||||
fn register(&mut self, addr: Address, node: BoundNode) {
|
||||
self.functions.insert(addr, node);
|
||||
}
|
||||
}
|
||||
|
||||
impl FunctionRegistry for MockRegistry {
|
||||
fn resolve(&self, addr: Address) -> Option<TypedNode> {
|
||||
fn resolve(&self, addr: Address) -> Option<BoundNode> {
|
||||
self.functions.get(&addr).cloned()
|
||||
}
|
||||
}
|
||||
@@ -259,19 +259,19 @@ mod tests {
|
||||
let name = Symbol::from("test_func");
|
||||
|
||||
// Def: (fn [x] x) -- generic identity
|
||||
let func_node = TypedNode {
|
||||
let func_node = BoundNode {
|
||||
identity: make_identity(),
|
||||
kind: BoundKind::Lambda {
|
||||
param_count: 1,
|
||||
upvalues: vec![],
|
||||
body: Rc::new(TypedNode { identity: make_identity(), kind: BoundKind::Nop, ty: StaticType::Void })
|
||||
body: Rc::new(BoundNode { identity: make_identity(), kind: BoundKind::Nop, ty: () })
|
||||
},
|
||||
ty: StaticType::Void
|
||||
ty: ()
|
||||
};
|
||||
registry.register(addr, func_node);
|
||||
|
||||
// Setup Compiler Mock
|
||||
let compiler: CompileFunc = Rc::new(|_node: TypedNode, _args: &[StaticType]| -> Result<(Value, StaticType), String> {
|
||||
let compiler: CompileFunc = Rc::new(|_node: BoundNode, _args: &[StaticType]| -> Result<(Value, StaticType), String> {
|
||||
// Return a specialized "compiled" value
|
||||
Ok((Value::Int(12345), StaticType::Int))
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user