| 124 | } |
| 125 | |
| 126 | @Test |
| 127 | public void testRecursive() throws IOException { |
| 128 | DrawDot dot = new DrawDot("top"); |
| 129 | dot.root().add(new Node("a")); |
| 130 | dot.root().add(new Node("b")); |
| 131 | dot.root().add(new Node("c")); |
| 132 | dot.root().add(new Connection(new Node("a"), new Node("b"))); |
| 133 | dot.root().add(new Connection(new Node("b"), new Node("c"))); |
| 134 | dot.root().add(new Connection(new Node("c"), new Node("b"))); |
| 135 | dot.root().add(new Connection(new Node("c"), new Node("a"))); |
| 136 | StringWriter sw = new StringWriter(); |
| 137 | dot.emit(sw); |
| 138 | LineSource left = source(sw.toString()); |
| 139 | LineSource right = source(DrawDotTest.this.getClass(), "drawdot2.dot"); |
| 140 | boolean cmp = stringsCompare(left, right, SKIP_BLANK, TRIM_LEADING_AND_TRAILING_WHITESPACE); |
| 141 | assertThat(cmp, is(true)); |
| 142 | } |
| 143 | |
| 144 | } |