use tsrun::Interpreter;
#[test]
fn test_repeated_prepare_free() {
for i in 1..=100 {
let mut interp = Interpreter::new();
match interp.prepare("1", None) {
Ok(_) => {}
Err(e) => panic!("Iteration {}: prepare failed: {}", i, e),
}
}
println!("100 iterations completed successfully");
}
#[test]
fn test_repeated_prepare_run_free() {
for i in 1..=100 {
let mut interp = Interpreter::new();
match interp.prepare("1", None) {
Ok(_) => {}
Err(e) => panic!("Iteration {}: prepare failed: {}", i, e),
}
loop {
match interp.step() {
Ok(tsrun::StepResult::Continue) => continue,
Ok(tsrun::StepResult::Complete(_)) | Ok(tsrun::StepResult::Done) => break,
Ok(other) => panic!("Iteration {}: unexpected step result: {:?}", i, other),
Err(e) => panic!("Iteration {}: step failed: {}", i, e),
}
}
}
println!("100 iterations completed successfully");
}