Skip to content

Commit

Permalink
unskip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
greged93 committed May 3, 2024
1 parent 2eb9703 commit 157f03d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
10 changes: 8 additions & 2 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions tests/tests/alexandria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
1 change: 0 additions & 1 deletion tests/tests/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 157f03d

Please sign in to comment.