#![allow(dead_code, unused_variables)]
extern crate mml;
use std::fmt::Debug;
#[derive(Debug)]
struct A<T> where T: Debug {
a: T,
}
impl<T> A<T> where T: Debug {
fn a(a: T) -> Self {
A {
a: a,
}
}
}
impl <T>B<T> for A<T> where T: Debug {
fn a(&self) -> Option<T> {
None
}
}
trait B<T> : Debug where T: Debug {
fn a(&self) -> Option<T>;
}
impl <T>B<T> {
fn a(&self) -> Option<T> {
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"];
}
"#);
}