Skip to content

Commit

Permalink
add test with negated outer reference
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoGiachetta committed Dec 20, 2024
1 parent ee21d2e commit e1f835f
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions vm/src/serde/deserialize_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down

0 comments on commit e1f835f

Please sign in to comment.