Skip to content

Commit

Permalink
refactor(test): improve test names
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Feb 9, 2024
1 parent 78a69a1 commit 6caa0e1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion triton-vm/src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ mod tests {
}

#[test]
fn test_sanity() {
fn sanity() {
let mut rng = rand::thread_rng();
let mut stack = vec![];
let steps = 100;
Expand Down
6 changes: 3 additions & 3 deletions triton-vm/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ mod tests {
}

#[test]
fn test_creating_program_from_code() {
fn create_program_from_code() {
let element_3 = thread_rng().gen_range(0_u64..BFieldElement::P);
let element_2 = 1337_usize;
let element_1 = "17";
Expand Down Expand Up @@ -939,7 +939,7 @@ mod tests {
}

#[test]
fn test_profile() {
fn profile_can_be_created_and_agrees_with_regular_vm_run() {
let program = CALCULATE_NEW_MMR_PEAKS_FROM_APPEND_WITH_SAFE_LISTS.clone();
let (profile_output, profile) = program.profile([].into(), [].into()).unwrap();
let mut vm_state = VMState::new(&program, [].into(), [].into());
Expand All @@ -954,7 +954,7 @@ mod tests {
}

#[test]
fn test_profile_with_open_calls() {
fn open_call_instructions_are_marked_in_its_profile() {
let program = triton_program! {
push 2 call outer_fn
outer_fn:
Expand Down
12 changes: 6 additions & 6 deletions triton-vm/src/stark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1816,12 +1816,12 @@ pub(crate) mod tests {
}

#[test]
fn triton_table_constraints_evaluate_to_zero_on_halt() {
fn constraints_evaluate_to_zero_on_halt() {
triton_constraints_evaluate_to_zero(test_program_for_halt());
}

#[test]
fn triton_table_constraints_evaluate_to_zero_on_fibonacci() {
fn constraints_evaluate_to_zero_on_fibonacci() {
let source_code_and_input = ProgramAndInput {
program: FIBONACCI_SEQUENCE.clone(),
public_input: vec![100],
Expand All @@ -1831,7 +1831,7 @@ pub(crate) mod tests {
}

#[test]
fn triton_table_constraints_evaluate_to_zero_on_big_mmr_snippet() {
fn constraints_evaluate_to_zero_on_big_mmr_snippet() {
let source_code_and_input = ProgramAndInput::without_input(
CALCULATE_NEW_MMR_PEAKS_FROM_APPEND_WITH_SAFE_LISTS.clone(),
);
Expand Down Expand Up @@ -2177,7 +2177,7 @@ pub(crate) mod tests {
}

#[test]
fn triton_prove_verify_simple_program() {
fn prove_verify_simple_program() {
let program_with_input = test_program_hash_nop_nop_lt();
let (stark, claim, proof) = prove_with_low_security_level(
&program_with_input.program,
Expand All @@ -2190,7 +2190,7 @@ pub(crate) mod tests {
}

#[test]
fn triton_prove_verify_halt() {
fn prove_verify_halt() {
let code_with_input = test_program_for_halt();
let mut profiler = Some(TritonProfiler::new("Prove Halt"));
let (stark, claim, proof) = prove_with_low_security_level(
Expand Down Expand Up @@ -2258,7 +2258,7 @@ pub(crate) mod tests {
}

#[test]
fn triton_prove_verify_many_u32_operations() {
fn prove_verify_many_u32_operations() {
let mut profiler = Some(TritonProfiler::new("Prove Many U32 Ops"));
let (stark, claim, proof) = prove_with_low_security_level(
&PROGRAM_WITH_MANY_U32_INSTRUCTIONS,
Expand Down
2 changes: 1 addition & 1 deletion triton-vm/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ pub(crate) mod tests {
ProgramAndInput::without_input(program)
}

// Sanity check for the relatively complex property-based test for random RAM access.
/// Sanity check for the relatively complex property-based test for random RAM access.
#[test]
fn run_dont_prove_property_based_test_for_random_ram_access() {
let source_code_and_input = property_based_test_program_for_random_ram_access();
Expand Down

0 comments on commit 6caa0e1

Please sign in to comment.