#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ProjectConfig {
pub name: std::string::String,
pub root_path: std::path::PathBuf,
pub graph: std::sync::Arc<crate::graph::hex_graph::HexGraph>,
}
impl ProjectConfig {
pub fn new(
name: std::string::String,
root_path: std::path::PathBuf,
graph: std::sync::Arc<crate::graph::hex_graph::HexGraph>,
) -> Self {
Self {
name,
root_path,
graph,
}
}
}
#[cfg(test)]
mod tests {
#[test]
fn test_project_config_creation() {
let graph = crate::graph::builder::GraphBuilder::new().build();
let config = super::ProjectConfig::new(
std::string::String::from("test_project"),
std::path::PathBuf::from("/path/to/project"),
std::sync::Arc::new(graph),
);
std::assert_eq!(config.name, "test_project");
std::assert_eq!(
config.root_path,
std::path::PathBuf::from("/path/to/project")
);
}
#[test]
fn test_project_config_clone() {
let graph = crate::graph::builder::GraphBuilder::new().build();
let config = super::ProjectConfig::new(
std::string::String::from("test"),
std::path::PathBuf::from("/path"),
std::sync::Arc::new(graph),
);
let cloned = config.clone();
std::assert_eq!(cloned.name, config.name);
}
}