1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * Copyright (c) Gabriel Amihalachioaie, SimpleG 2023.
 */
use std::path::{Path, PathBuf};

pub fn get_integration_test_data_path(test_file_name: &str) -> PathBuf {
    let test_data_path_string = test_file_name
        .replace("tests/", "test_data/")
        .replace(".rs", "");
    let test_data_path = Path::new(test_data_path_string.as_str());

    test_data_path.to_path_buf()
}

pub fn get_unit_test_data_path(test_file_name: &str) -> PathBuf {
    let test_data_path_string = test_file_name
        .replace("src/", "test_data/")
        .replace(".rs", "");

    let test_data_path = Path::new(test_data_path_string.as_str());

    test_data_path.to_path_buf()
}