feat: execute source control flow and exact real arithmetic
This commit is contained in:
@@ -1593,7 +1593,22 @@ fn managed_coroutine_hard_budget_accumulates_and_error_releases_frames() {
|
||||
use endor_core::CoroutineProgress;
|
||||
let mut vm = Vm::new().unwrap();
|
||||
let globals = vm.new_dict().unwrap();
|
||||
let code = return_constant(&mut vm, Value::Nil);
|
||||
// Reaching ReturnValue at the limit succeeds; keep a third instruction
|
||||
// beyond the hard limit to exercise failure before the next Pending yield.
|
||||
let code = vm
|
||||
.new_code(
|
||||
EndorCode::from_instructions(
|
||||
&[
|
||||
Instruction::simple(Opcode::Nop),
|
||||
Instruction::new(Opcode::LoadConst, 0),
|
||||
Instruction::simple(Opcode::ReturnValue),
|
||||
],
|
||||
vec![Value::Nil],
|
||||
CodeLayout::default(),
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
let function = vm
|
||||
.new_function("limited", code, globals, vec![], vec![])
|
||||
.unwrap();
|
||||
@@ -1603,7 +1618,9 @@ fn managed_coroutine_hard_budget_accumulates_and_error_releases_frames() {
|
||||
&[],
|
||||
ExecutionLimits {
|
||||
max_frames: 4,
|
||||
max_instructions: 1,
|
||||
// The second resume reaches the cumulative limit before
|
||||
// the third instruction, without replaying the first.
|
||||
max_instructions: 2,
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user