Skip to main content

Module test_utils

Module test_utils 

Source

Functions§

fill_ids_data_for_test
Test helper: Create a HashMap of HintReferences for testing, keyed by name. Output: { “name1”: HintReference::new_simple(-num), “name2”: HintReference::new_simple(-num + 1), … “nameN”: HintReference::new_simple(-1), } where num is the length of names.
get_hint_codes_at_pc
Utility function to extract all hint code strings from a HintExtension at a given PC.
prepare_non_continuous_ids_data_for_test
Test helper: Create a HashMap of HintReferences for testing, keyed by name and offset. example output: (notice that some offsets are skipped) { “name1”: HintReference::new_simple(-1), “name2”: HintReference::new_simple(-3), “name3”: HintReference::new_simple(-10) … },
prepare_refrences_for_test
Test helper: Create a HashMap of HintReferences for testing. Output: { 0: HintReference::new_simple(-num), 1: HintReference::new_simple(-num + 1), … num - 1: HintReference::new_simple(-1), num: HintReference::new_simple(0), }
prepare_vm_for_load_program_loading_test
Utility: Prepares a VM, ids_data, exec_scopes, ap_tracking, and pointers for bootloader tests. After this function is executed the VM has 3 segments, and the program header is at (2, 0). The task is inserted into the execution scopes. load_program_hint should succeed after this function.