Skip to content

Commit

Permalink
Add dynamic test to cairo-vm-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGCalderon committed Sep 18, 2024
1 parent fca3cbf commit eb63b5c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cairo-vm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,19 @@ mod tests {
assert_matches!(run(args), Err(Error::Runner(_)));
}

#[test]
fn test_run_dynamic_params() {
let mut args = vec!["cairo-vm-cli".to_string()];
args.extend_from_slice(&["--layout".to_string(), "dynamic".to_string()]);
args.extend_from_slice(&[
"--cairo_layout_params_file".to_string(),
"../cairo_layout_params_file.json".to_string(),
]);
args.push("../cairo_programs/proof_programs/fibonacci.json".to_string());

assert_matches!(run(args.into_iter()), Ok(_));
}

//Since the functionality here is trivial, I just call the function
//to fool Codecov.
#[test]
Expand Down
13 changes: 13 additions & 0 deletions cairo1-run/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,19 @@ mod tests {
assert_matches!(run(args), Ok(Some(res)) if res == expected_output, "Program {} failed with flags {}", program, extra_flags.concat());
}

#[test]
fn test_run_dynamic_params() {
let mut args = vec!["cairo1-run".to_string()];
args.extend_from_slice(&["--layout".to_string(), "dynamic".to_string()]);
args.extend_from_slice(&[
"--cairo_layout_params_file".to_string(),
"../cairo_layout_params_file.json".to_string(),
]);
args.push("../cairo_programs/cairo-1-programs/fibonacci.cairo".to_string());

assert_matches!(run(args.into_iter()), Ok(_));
}

// these tests are separated so as to run them without --append_return_values and --proof_mode options
// since they require to use the squashed version of felt252
#[rstest]
Expand Down

0 comments on commit eb63b5c

Please sign in to comment.