diff --git a/vm/src/serde/deserialize_utils.rs b/vm/src/serde/deserialize_utils.rs index b69ee10f2e..766a8c7609 100644 --- a/vm/src/serde/deserialize_utils.rs +++ b/vm/src/serde/deserialize_utils.rs @@ -402,15 +402,6 @@ mod tests { ); } - #[test] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] - fn parse_value_with_neg_inner_dereference_test() { - let value = "cast(17 - [fp], felt)"; - let parsed = parse_value(value).unwrap(); - - dbg!(parsed); - } - #[test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] fn parse_value_with_inner_dereference_test() { @@ -432,6 +423,27 @@ mod tests { ); } + #[test] + #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] + fn parse_value_with_neg_inner_dereference_test() { + let value = "cast(17 - [fp], felt)"; + let parsed = parse_value(value).unwrap(); + + assert_eq!( + parsed, + ( + "", + ValueAddress { + offset1: OffsetValue::Immediate(Felt252::from(17)), + offset2: OffsetValue::Reference(Register::FP, 0_i32, true, true), + outer_dereference: true, + inner_dereference: false, + value_type: "felt".to_string() + } + ) + ) + } + #[test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] fn parse_value_with_no_inner_dereference_test() {