style: cargo fmt
This commit is contained in:
@@ -24,13 +24,15 @@ fn graph_with_one_module() -> NormalizedGraph {
|
||||
let analyzer = FakeSourceAnalyzer::new().with_result(
|
||||
"/p/src/orders/order.rs",
|
||||
AnalysisResult::new(
|
||||
vec![CodeElement::new(
|
||||
"Order",
|
||||
CodeElementKind::Struct,
|
||||
FilePath::new("/p/src/orders/order.rs").unwrap(),
|
||||
1,
|
||||
)
|
||||
.unwrap()],
|
||||
vec![
|
||||
CodeElement::new(
|
||||
"Order",
|
||||
CodeElementKind::Struct,
|
||||
FilePath::new("/p/src/orders/order.rs").unwrap(),
|
||||
1,
|
||||
)
|
||||
.unwrap(),
|
||||
],
|
||||
vec![],
|
||||
vec![],
|
||||
),
|
||||
@@ -44,12 +46,22 @@ fn graph_with_one_module() -> NormalizedGraph {
|
||||
|
||||
fn graph_with_violation() -> NormalizedGraph {
|
||||
let mut cg = CodeGraph::new();
|
||||
let a = CodeElement::new("A", CodeElementKind::Struct, FilePath::new("a.rs").unwrap(), 1)
|
||||
.unwrap()
|
||||
.with_module(ModuleName::new("Alpha").unwrap());
|
||||
let b = CodeElement::new("B", CodeElementKind::Struct, FilePath::new("b.rs").unwrap(), 1)
|
||||
.unwrap()
|
||||
.with_module(ModuleName::new("Beta").unwrap());
|
||||
let a = CodeElement::new(
|
||||
"A",
|
||||
CodeElementKind::Struct,
|
||||
FilePath::new("a.rs").unwrap(),
|
||||
1,
|
||||
)
|
||||
.unwrap()
|
||||
.with_module(ModuleName::new("Alpha").unwrap());
|
||||
let b = CodeElement::new(
|
||||
"B",
|
||||
CodeElementKind::Struct,
|
||||
FilePath::new("b.rs").unwrap(),
|
||||
1,
|
||||
)
|
||||
.unwrap()
|
||||
.with_module(ModuleName::new("Beta").unwrap());
|
||||
cg.add_element(a);
|
||||
cg.add_element(b);
|
||||
cg.add_relationship(Relationship::new("A", "B", RelationshipKind::Composition).unwrap());
|
||||
|
||||
Reference in New Issue
Block a user