From d026a1ee89d705b97bd64349f638b98988feaa65 Mon Sep 17 00:00:00 2001 From: Rigidity Date: Mon, 28 Oct 2024 16:16:35 -0400 Subject: [PATCH] Fixes 2 --- src/run_program.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/run_program.rs b/src/run_program.rs index 1117a886..2a23b531 100644 --- a/src/run_program.rs +++ b/src/run_program.rs @@ -1300,41 +1300,6 @@ mod tests { } } - fn check(res: (NodePtr, &str)) -> NodePtr { - assert_eq!(res.1, ""); - res.0 - } - - fn run_test_case(t: &RunProgramTest) { - use crate::chia_dialect::ChiaDialect; - use crate::test_ops::node_eq; - let mut allocator = Allocator::new(); - - let program = check(parse_exp(&mut allocator, t.prg)); - let args = check(parse_exp(&mut allocator, t.args)); - let expected_result = &t.result.map(|v| check(parse_exp(&mut allocator, v))); - - let dialect = ChiaDialect::new(t.flags); - println!("prg: {}", t.prg); - match run_program(&mut allocator, &dialect, program, args, t.cost) { - Ok(Reduction(cost, prg_result)) => { - assert!(node_eq(&allocator, prg_result, expected_result.unwrap())); - assert_eq!(cost, t.cost); - - // now, run the same program again but with the cost limit 1 too low, to - // ensure it fails with the correct error - let expected_cost_exceeded = - run_program(&mut allocator, &dialect, program, args, t.cost - 1).unwrap_err(); - assert_eq!(expected_cost_exceeded.1, "cost exceeded"); - } - Err(err) => { - println!("FAILED: {}", err.1); - assert_eq!(err.1, t.err); - assert!(expected_result.is_none()); - } - } - } - // the test cases for this test consists of: // prg: the program to run inside the softfork guard // cost: the expected cost of the program (the test adds the apply-operator)