From 7a9102a61b6d0552a79922f0694ede748488abfb Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Wed, 14 Aug 2024 11:49:21 +0200 Subject: [PATCH] refactor(test): Simplify spec generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the constraints are not in place, the corresponding error message is well suited to figure out what is going on. Since this is a test, not a piece of production code, that's all that's needed. Adding special error handling logic, especially with the to-be-avoided “catch_unwind”, is overkill. changelog: ignore --- triton-vm/src/table/master_table.rs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/triton-vm/src/table/master_table.rs b/triton-vm/src/table/master_table.rs index 57c2e5286..db1f250e6 100644 --- a/triton-vm/src/table/master_table.rs +++ b/triton-vm/src/table/master_table.rs @@ -1503,22 +1503,12 @@ mod tests { #[test] fn update_arithmetization_overview() { - let mut spec_snippets = vec![generate_table_overview(), generate_constraints_overview()]; - - let tasm_constraints_in_place = std::panic::catch_unwind(|| { - static_air_constraint_evaluation_tasm( - StaticTasmConstraintEvaluationMemoryLayout::default(), - ); - }) - .is_ok(); - if tasm_constraints_in_place { - spec_snippets.push(generate_tasm_air_evaluation_cost_overview()); - } else { - println!("Cannot verify spec's overview of tasm cost of AIR evaluation; tasm constraints need to be in place for that. To generate them, run:\n"); - println!("$> cargo run --bin constraint-evaluation-generator"); - } - - spec_snippets.push(generate_opcode_pressure_overview()); + let spec_snippets = vec![ + generate_table_overview(), + generate_constraints_overview(), + generate_tasm_air_evaluation_cost_overview(), + generate_opcode_pressure_overview(), + ]; // current directory is triton-vm/triton-vm/ let spec_path = Path::new("../specification/src/arithmetization-overview.md");