Skip to content

Commit

Permalink
fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
odesenfans committed Feb 8, 2024
1 parent 9f110ab commit b3a1851
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions vm/src/vm/runners/builtin_runner/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,27 @@ mod tests {
assert_eq!(state, new_state);
}

#[test]
fn new_state() {
let mut builtin = OutputBuiltinRunner {
base: 10,
pages: HashMap::from([(1, PublicMemoryPage { start: 0, size: 3 })]),
attributes: HashMap::from([("gps_fact_topology".to_string(), vec![0, 2, 0])]),
stop_ptr: Some(10),
included: true,
};

let new_base = 11;
let new_included = false;
builtin.new_state(new_base, new_included);

assert_eq!(builtin.base, new_base);
assert!(builtin.pages.is_empty());
assert!(builtin.attributes.is_empty());
assert_eq!(builtin.stop_ptr, None);
assert_eq!(builtin.included, new_included);
}

#[test]
fn add_page() {
let mut builtin = OutputBuiltinRunner::new(true);
Expand Down

0 comments on commit b3a1851

Please sign in to comment.