From 157f03de41d6511f6ecf907e4c136529a021747b Mon Sep 17 00:00:00 2001 From: Gregory Edison Date: Fri, 3 May 2024 14:49:01 +0200 Subject: [PATCH] unskip tests --- tests/common.rs | 10 ++++++++-- tests/tests/alexandria.rs | 6 +++--- tests/tests/cases.rs | 2 +- tests/tests/dict.rs | 1 - 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/common.rs b/tests/common.rs index bd3c5d3c4..68fe8b84a 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -321,8 +321,6 @@ pub fn run_native_starknet_contract( /// Given the result of the cairo-vm and cairo-native of the same program, it compares /// the results automatically, triggering a proptest assert if there is a mismatch. /// -/// If ignore_gas is false, it will check whether the resulting gas matches. -/// /// Left of report of the assert is the cairo vm result, right side is cairo native #[track_caller] pub fn compare_outputs( @@ -547,6 +545,14 @@ pub fn compare_outputs( .map(|x| x.starts_with("core::panics::PanicResult")) .unwrap_or(false); + assert_eq!( + vm_result + .gas_counter + .clone() + .unwrap_or_else(|| Felt252::from(0)), + Felt252::from(native_result.remaining_gas.unwrap_or(0)), + ); + let vm_result = match &vm_result.value { RunResultValue::Success(values) => { if returns_panic { diff --git a/tests/tests/alexandria.rs b/tests/tests/alexandria.rs index 75152fa76..88495a542 100644 --- a/tests/tests/alexandria.rs +++ b/tests/tests/alexandria.rs @@ -50,10 +50,10 @@ fn compare_inputless_function(function_name: &str) { #[test_case("aliquot_sum")] #[test_case("extended_euclidean_algorithm")] // alexandria_data_structures -#[test_case("vec" => ignore["Gas mismatch"])] -#[test_case("stack" => ignore["Gas mismatch"])] +#[test_case("vec")] +#[test_case("stack")] #[test_case("queue")] -#[test_case("bit_array" => ignore["Gas mismatch"])] +#[test_case("bit_array")] // alexandria_encoding #[test_case("base64_encode" => ignore["Gas mismatch"])] #[test_case("reverse_bits")] diff --git a/tests/tests/cases.rs b/tests/tests/cases.rs index 13114c186..22262c69e 100644 --- a/tests/tests/cases.rs +++ b/tests/tests/cases.rs @@ -42,7 +42,7 @@ use test_case::test_case; #[test_case("tests/cases/returns/simple.cairo")] #[test_case("tests/cases/returns/tuple.cairo")] // dict -#[test_case("tests/cases/dict/insert_get.cairo" => ignore["gas mismatch"])] +#[test_case("tests/cases/dict/insert_get.cairo")] // uint #[test_case("tests/cases/uint/compare.cairo")] #[test_case("tests/cases/uint/consts.cairo")] diff --git a/tests/tests/dict.rs b/tests/tests/dict.rs index 81c4feeae..3b9d32682 100644 --- a/tests/tests/dict.rs +++ b/tests/tests/dict.rs @@ -23,7 +23,6 @@ lazy_static! { proptest! { #[test] - #[ignore = "gas mismatch in dicts"] fn dict_get_insert_proptest(a in any_felt(), b in any_felt()) { let program = &DICT_GET_INSERT; let result_vm = run_vm_program(