test: green up after Phase 2 merge for #26\n\n- Fix AST tests (is_override)\n- Align MIR builder test with current If AST\n- Adjust ResultBox API usage in tests\n- Add len() helpers to ArrayBox/BufferBox for tests

This commit is contained in:
Moe Charm
2025-08-13 11:53:34 +09:00
parent c6f76505b5
commit 2eba31143a
107 changed files with 6435 additions and 13 deletions

View File

@ -469,19 +469,20 @@ mod tests {
fn test_if_statement_building() {
let mut builder = MirBuilder::new();
let ast = ASTNode::IfStatement {
// Adapt test to current AST: If with statement bodies
let ast = ASTNode::If {
condition: Box::new(ASTNode::Literal {
value: LiteralValue::Boolean(true),
value: LiteralValue::Bool(true),
span: Span::unknown(),
}),
then_branch: Box::new(ASTNode::Literal {
then_body: vec![ASTNode::Literal {
value: LiteralValue::Integer(1),
span: Span::unknown(),
}),
else_branch: Some(Box::new(ASTNode::Literal {
}],
else_body: Some(vec![ASTNode::Literal {
value: LiteralValue::Integer(2),
span: Span::unknown(),
})),
}]),
span: Span::unknown(),
};
@ -498,4 +499,4 @@ mod tests {
let stats = function.stats();
assert!(stats.phi_count >= 1);
}
}
}