#![allow(dead_code)] extern crate rust2uml; struct A { } impl A { fn b() -> B { B { } } } struct Ab { } impl Ab { fn b() -> B { B { } } } struct B { } impl B { fn a() -> Ab { Ab { } } } #[test] fn test_association() { assert_eq!( String::from_utf8(rust2uml::rs2dot("tests/association.rs").unwrap()).unwrap(), r#"digraph ml { ndA[label="{<<<Structure>>>\nA|- b() -> B}"][shape="record"]; ndAb[label="{<<<Structure>>>\nAb|- b() -> B}"][shape="record"]; ndB[label="{<<<Structure>>>\nB|- a() -> Ab}"][shape="record"]; ndAb -> ndB[label=""][arrowhead="none"]; ndB -> ndA[label=""][arrowhead="vee"]; } "#); }