Skip to content

Commit

Permalink
feat: add project struct for psa.
Browse files Browse the repository at this point in the history
  • Loading branch information
ynfeng committed Feb 22, 2021
1 parent e08d030 commit 7bfd2de
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
3 changes: 3 additions & 0 deletions psa/src/Facet.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct Facet {

}
3 changes: 3 additions & 0 deletions psa/src/Library.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct Library {

}
1 change: 1 addition & 0 deletions psa/src/Module.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub struct Module {}
3 changes: 2 additions & 1 deletion psa/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@

pub mod module;
pub mod project;
25 changes: 25 additions & 0 deletions psa/src/project.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use crate::module::Module;

pub struct Project {
pub name: String,
pub path: String,
pub modules: Vec<Module>,
}

#[cfg(test)]
mod tests {
use crate::project::Project;

#[test]
fn should_create_project() {
let project = Project {
name: "foo".to_string(),
path: "test/path".to_string(),
modules: vec![],
};

assert_eq!(project.name, "foo".to_string());
assert_eq!(project.path, "test/path".to_string());
assert_eq!(project.modules.is_empty(), true);
}
}

0 comments on commit 7bfd2de

Please sign in to comment.