Skip to content

Commit

Permalink
Add snapshot project 'github_issue_102'
Browse files Browse the repository at this point in the history
  • Loading branch information
regexident committed Nov 30, 2023
1 parent 8cff066 commit 5f087a7
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/generate_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,16 @@ mod github_issue_80 {
}
}

mod github_issue_102 {
test_cmd!(
args: "generate graph \
--uses",
success: true,
color_mode: ColorMode::Plain,
project: github_issue_102
);
}

mod github_issue_172 {
test_cmd!(
args: "generate graph \
Expand Down
4 changes: 4 additions & 0 deletions tests/projects/github_issue_102/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
name = "github_issue_102"
version = "0.1.0"
edition = "2018"
15 changes: 15 additions & 0 deletions tests/projects/github_issue_102/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pub mod a {
use self::b::X;

pub mod b {
pub struct X {}
}
pub mod c {
pub struct Y {}
}

pub struct Z {
x: X,
y: c::Y,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
source: tests/generate_graph.rs
expression: output
---
STDERR:

STDOUT:
digraph {

graph [
label="github_issue_102",
labelloc=t,

pad=0.4,

// Consider rendering the graph using a different layout algorithm, such as:
// [dot, neato, twopi, circo, fdp, sfdp]
layout=neato,
overlap=false,
splines="line",
rankdir=LR,

fontname="Helvetica",
fontsize="36",
];

node [
fontname="monospace",
fontsize="10",
shape="record",
style="filled",
];

edge [
fontname="monospace",
fontsize="10",
];

"github_issue_102" [label="crate|github_issue_102", fillcolor="#5397c8"]; // "crate" node
"github_issue_102::a" [label="pub mod|a", fillcolor="#81c169"]; // "mod" node
"github_issue_102::a::b" [label="pub mod|a::b", fillcolor="#81c169"]; // "mod" node
"github_issue_102::a::c" [label="pub mod|a::c", fillcolor="#81c169"]; // "mod" node

"github_issue_102" -> "github_issue_102::a" [label="owns", color="#000000", style="solid"] [constraint=true]; // "owns" edge
"github_issue_102::a" -> "github_issue_102::a::b" [label="owns", color="#000000", style="solid"] [constraint=true]; // "owns" edge
"github_issue_102::a" -> "github_issue_102::a::b" [label="uses", color="#7f7f7f", style="dashed"] [constraint=false]; // "uses" edge
"github_issue_102::a" -> "github_issue_102::a::c" [label="owns", color="#000000", style="solid"] [constraint=true]; // "owns" edge
"github_issue_102::a" -> "github_issue_102::a::c" [label="uses", color="#7f7f7f", style="dashed"] [constraint=false]; // "uses" edge

}

0 comments on commit 5f087a7

Please sign in to comment.