From 6caa0e1a9edb4b0b45f27f9c2613d1034a48c376 Mon Sep 17 00:00:00 2001 From: Jan Ferdinand Sauer Date: Fri, 9 Feb 2024 09:24:57 +0100 Subject: [PATCH] refactor(test): improve test names --- triton-vm/src/profiler.rs | 2 +- triton-vm/src/program.rs | 6 +++--- triton-vm/src/stark.rs | 12 ++++++------ triton-vm/src/vm.rs | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/triton-vm/src/profiler.rs b/triton-vm/src/profiler.rs index 1fd073c41..aab5f5a02 100644 --- a/triton-vm/src/profiler.rs +++ b/triton-vm/src/profiler.rs @@ -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; diff --git a/triton-vm/src/program.rs b/triton-vm/src/program.rs index 689a2ec77..2c8e73ac0 100644 --- a/triton-vm/src/program.rs +++ b/triton-vm/src/program.rs @@ -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"; @@ -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()); @@ -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: diff --git a/triton-vm/src/stark.rs b/triton-vm/src/stark.rs index 6aa8fcde1..5e7775475 100644 --- a/triton-vm/src/stark.rs +++ b/triton-vm/src/stark.rs @@ -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], @@ -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(), ); @@ -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, @@ -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( @@ -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, diff --git a/triton-vm/src/vm.rs b/triton-vm/src/vm.rs index 1d36e7ef3..4bf829455 100644 --- a/triton-vm/src/vm.rs +++ b/triton-vm/src/vm.rs @@ -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();