#![allow(dead_code, unused_variables)] extern crate mml; use std::fmt::Debug; #[derive(Debug)] struct A where T: Debug { a: T, } impl A where T: Debug { fn a(a: T) -> Self { A { a: a, } } } impl B for A where T: Debug { fn a(&self) -> Option { None } } trait B : Debug where T: Debug { fn a(&self) -> Option; } impl B { fn a(&self) -> Option { None } } #[test] fn test_realization() { assert_eq!(String::from_utf8(mml::rs2dot("tests/realization.rs").unwrap()).unwrap(), r#"digraph ml { ndA[label="{<<<Structure>>>\nA|- a: T|- a(a: T) -> Self}"][shape="record"]; ndB[label="{<<<Trait>>>\nB|a(&Self) -> Option<T>|- a(&self) -> Option<T>}"][shape="record"]; ndB -> ndA[label=""][style="dashed"][arrowhead="onormal"]; } "#); }