From 71013e9d2b9d1d920081cdfa16a72e79ab611f35 Mon Sep 17 00:00:00 2001 From: Arni Hod Date: Wed, 17 Jul 2024 14:05:53 +0300 Subject: [PATCH] chore: set empty relative_path --- crates/mempool_test_utils/src/starknet_api_test_utils.rs | 4 ++-- crates/starknet_sierra_compile/src/compile_test.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/mempool_test_utils/src/starknet_api_test_utils.rs b/crates/mempool_test_utils/src/starknet_api_test_utils.rs index 4f5cbce21..3aed52d2d 100644 --- a/crates/mempool_test_utils/src/starknet_api_test_utils.rs +++ b/crates/mempool_test_utils/src/starknet_api_test_utils.rs @@ -92,8 +92,8 @@ pub fn executable_resource_bounds_mapping() -> ResourceBoundsMapping { /// Get the contract class used for testing. pub fn contract_class() -> ContractClass { - env::set_current_dir(get_absolute_path(TEST_FILES_FOLDER)).expect("Couldn't set working dir."); - let json_file_path = Path::new(CONTRACT_CLASS_FILE); + env::set_current_dir(get_absolute_path("")).expect("Couldn't set working dir."); + let json_file_path = Path::new(TEST_FILES_FOLDER).join(CONTRACT_CLASS_FILE); serde_json::from_reader(File::open(json_file_path).unwrap()).unwrap() } diff --git a/crates/starknet_sierra_compile/src/compile_test.rs b/crates/starknet_sierra_compile/src/compile_test.rs index 14e0b3d13..2afb5f3d2 100644 --- a/crates/starknet_sierra_compile/src/compile_test.rs +++ b/crates/starknet_sierra_compile/src/compile_test.rs @@ -10,8 +10,8 @@ use crate::test_utils::contract_class_from_file; #[test] fn test_compile_sierra_to_casm() { - env::set_current_dir(get_absolute_path(TEST_FILES_FOLDER)).expect("Failed to set current dir."); - let sierra_path = Path::new(FAULTY_ACCOUNT_CLASS_FILE); + env::set_current_dir(get_absolute_path("")).expect("Failed to set current dir."); + let sierra_path = Path::new(TEST_FILES_FOLDER).join(FAULTY_ACCOUNT_CLASS_FILE); let expected_casm_contract_length = 72304; let contract_class = contract_class_from_file(sierra_path); @@ -24,8 +24,8 @@ fn test_compile_sierra_to_casm() { // TODO(Arni, 1/5/2024): Add a test for panic result test. #[test] fn test_negative_flow_compile_sierra_to_casm() { - env::set_current_dir(get_absolute_path(TEST_FILES_FOLDER)).expect("Failed to set current dir."); - let sierra_path = Path::new(FAULTY_ACCOUNT_CLASS_FILE); + env::set_current_dir(get_absolute_path("")).expect("Failed to set current dir."); + let sierra_path = Path::new(TEST_FILES_FOLDER).join(FAULTY_ACCOUNT_CLASS_FILE); let mut contract_class = contract_class_from_file(sierra_path); // Truncate the sierra program to trigger an error.