Debian Codegraph @

src/ascii_large.rs

raw symbols SCIP
1 /*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::markerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/::PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#;
9
10 use itertoolsrust-analyzer cargo itertools 0.15.0 crate/::Itertoolsrust-analyzer cargo itertools 0.15.0 Itertools#;
11
12 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::outputrust-analyzer cargo esl01-renderdag 0.3.0 output/::OutputRendererOptionsrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererOptions#;
13 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::renderrust-analyzer cargo esl01-renderdag 0.3.0 render/::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#;
14 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::renderrust-analyzer cargo esl01-renderdag 0.3.0 render/::GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#;
15 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::renderrust-analyzer cargo esl01-renderdag 0.3.0 render/::LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#;
16 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::renderrust-analyzer cargo esl01-renderdag 0.3.0 render/::NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#;
17 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::renderrust-analyzer cargo esl01-renderdag 0.3.0 render/::PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#;
18 use superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::renderrust-analyzer cargo esl01-renderdag 0.3.0 render/::Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#;
19
20 pub struct AsciiLargeRendererrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#<N, R>
21 where
22 R: Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#<N, Outputrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#Output# = GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#<N>> + Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#,
23 {
24 innerrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#inner.: R,
25 optionsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#options.: OutputRendererOptionsrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererOptions#,
26 extra_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#extra_pad_line.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
27 _phantomrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#_phantom.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<N>,
28 }
29
30 impl<N, R> AsciiLargeRendererrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#<N, R>
31 where
32 R: Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#<N, Outputrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#Output# = GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#<N>> + Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#,
33 {
34 pub(craterust-analyzer cargo esl01-renderdag 0.3.0 crate/) fn newrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/impl#[`AsciiLargeRenderer<N, R>`]new().(inner: R, options: OutputRendererOptionsrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererOptions#) -> Selfrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/impl#[`AsciiLargeRenderer<N, R>`] {
35 AsciiLargeRendererrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer# {
36 innerrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#inner.,
37 optionsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#options.,
38 extra_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#extra_pad_line.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
39 _phantomrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#_phantom.: PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#,
40 }
41 }
42 }
43
44 impl<N, R> Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#<N> for AsciiLargeRendererrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#<N, R>
45 where
46 N: Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# + Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq#,
47 R: Rendererrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#<N, Outputrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#Output# = GraphRowrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#<N>> + Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#,
48 {
49 type Outputrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/impl#[`AsciiLargeRenderer<N, R>`][`Renderer<N>`]Output# = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#;
50
51 fn widthrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/impl#[`AsciiLargeRenderer<N, R>`][`Renderer<N>`]width().(&self, node: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&N>, parents: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<&Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>>) -> u64 {
52 // The first column is only 2 characters wide.
53 self.innerrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#inner.
54 .widthrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#width().(node, parents)
55 .saturating_mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]saturating_mul().(3)
56 .saturating_subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]saturating_sub().(1)
57 .saturating_addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u64]saturating_add().(1)
58 }
59
60 fn reserverust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/impl#[`AsciiLargeRenderer<N, R>`][`Renderer<N>`]reserve().(&mut self, node: N) {
61 self.innerrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#inner..reserverust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#reserve().(node);
62 }
63
64 fn next_rowrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/impl#[`AsciiLargeRenderer<N, R>`][`Renderer<N>`]next_row().(
65 &mut self,
66 node: N,
67 parents: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/Ancestor#<N>>,
68 glyph: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
69 message: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
70 ) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
71 let line = self.innerrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#inner..next_rowrust-analyzer cargo esl01-renderdag 0.3.0 render/Renderer#next_row().(node, parents, glyph, message);
72 let mut out = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
73 let mut message_lines = line
74 .messagerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#message.
75 .linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().()
76 .pad_usingrust-analyzer cargo itertools 0.15.0 Itertools#pad_using().(self.optionsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#options..min_row_heightrust-analyzer cargo esl01-renderdag 0.3.0 output/OutputRendererOptions#min_row_height., |_| "");
77 let mut need_extra_pad_line = false;
78
79 // Render the previous extra pad line
80 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(extra_pad_line) = self.extra_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#extra_pad_line..takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]take().() {
81 out.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(extra_pad_line.trim_endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end().());
82 out.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\n');
83 }
84
85 // Render the nodeline
86 let mut node_line = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
87 for (i, entry) in line.node_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#node_line..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
88 match entry {
89 NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Noderust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Node# => {
90 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
91 node_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
92 }
93 node_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(&line.glyphrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#glyph.);
94 node_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
95 }
96 NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Parent# => node_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 { " | " } else { "| " }),
97 NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Ancestor# => node_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 { " . " } else { ". " }),
98 NodeLinerust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/NodeLine#Blank# => node_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 { " " } else { " " }),
99 }
100 }
101 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(msg) = message_lines.nextrust-analyzer cargo itertools 0.15.0 pad_tail/impl#[`PadUsing<I, F>`][Iterator]next().() {
102 node_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
103 node_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(msg);
104 }
105 out.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(node_line.trim_endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end().());
106 out.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\n');
107
108 // Render the link line
109 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(link_row) = line.link_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#link_line. {
110 let mut top_link_line = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
111 let mut bot_link_line = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
112 for (i, cur) in link_row.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
113 // Top left
114 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
115 if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_PARENT.) {
116 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('/');
117 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_MERGE_ANCESTOR.) {
118 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
119 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_PARENT.) {
120 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('_');
121 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_ANCESTOR.) {
122 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
123 } else {
124 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
125 }
126 }
127
128 // Top center
129 if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_PARENT.) {
130 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('|');
131 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_ANCESTOR.) {
132 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
133 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::ANY_MERGErust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]ANY_MERGE.) {
134 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
135 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_PARENT.) {
136 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('_');
137 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_ANCESTOR.) {
138 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
139 } else {
140 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
141 }
142
143 // Top right
144 if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_MERGE_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE_PARENT.) {
145 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\\');
146 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_MERGE_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_MERGE_ANCESTOR.) {
147 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
148 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_PARENT.) {
149 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('_');
150 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::HORIZ_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]HORIZ_ANCESTOR.) {
151 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
152 } else {
153 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
154 }
155
156 // Bottom left
157 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
158 if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK_PARENT.) {
159 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\\');
160 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::LEFT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]LEFT_FORK_ANCESTOR.) {
161 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
162 } else {
163 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
164 }
165 }
166
167 // Bottom center
168 if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_PARENT.) {
169 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('|');
170 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::VERT_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]VERT_ANCESTOR.) {
171 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
172 } else {
173 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
174 }
175
176 // Bottom Right
177 if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_FORK_PARENTrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_PARENT.) {
178 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('/');
179 } else if cur.intersectsrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]intersects().(LinkLinerust-analyzer cargo esl01-renderdag 0.3.0 render/LinkLine#::RIGHT_FORK_ANCESTORrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[LinkLine]RIGHT_FORK_ANCESTOR.) {
180 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('.');
181 } else {
182 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
183 }
184 }
185 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(msg) = message_lines.nextrust-analyzer cargo itertools 0.15.0 pad_tail/impl#[`PadUsing<I, F>`][Iterator]next().() {
186 top_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
187 top_link_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(msg);
188 }
189 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(msg) = message_lines.nextrust-analyzer cargo itertools 0.15.0 pad_tail/impl#[`PadUsing<I, F>`][Iterator]next().() {
190 bot_link_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
191 bot_link_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(msg);
192 }
193 out.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(top_link_line.trim_endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end().());
194 out.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\n');
195 out.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(bot_link_line.trim_endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end().());
196 out.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\n');
197 }
198
199 // Render the term line
200 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(term_row) = line.term_linerust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#term_line. {
201 let term_strs = ["| ", "~ "];
202 for term_str in term_strs.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() {
203 let mut term_line = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
204 for (i, term) in term_row.iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
205 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
206 term_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
207 }
208 if *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().term {
209 term_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(term_str);
210 } else {
211 term_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(match line.pad_linesrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#pad_lines.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().i]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index(). {
212 PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Parent# => "| ",
213 PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Ancestor# => ". ",
214 PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Blank# => " ",
215 });
216 }
217 }
218 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(msg) = message_lines.nextrust-analyzer cargo itertools 0.15.0 pad_tail/impl#[`PadUsing<I, F>`][Iterator]next().() {
219 term_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
220 term_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(msg);
221 }
222 out.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(term_line.trim_endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end().());
223 out.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\n');
224 }
225 need_extra_pad_line = true;
226 }
227
228 let mut base_pad_line = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().();
229 for (i, entry) in line.pad_linesrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRow#pad_lines..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
230 base_pad_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(match entry {
231 PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Parentrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Parent# => {
232 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
233 " | "
234 } else {
235 "| "
236 }
237 }
238 PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Ancestorrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Ancestor# => {
239 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
240 " . "
241 } else {
242 ". "
243 }
244 }
245 PadLinerust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#::Blankrust-analyzer cargo esl01-renderdag 0.3.0 render/PadLine#Blank# => {
246 if i rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().0 {
247 " "
248 } else {
249 " "
250 }
251 }
252 });
253 }
254
255 // Render any pad lines
256 for msg in message_lines {
257 let mut pad_line = base_pad_line.clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][Clone]clone().();
258 pad_line.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().(' ');
259 pad_line.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(msg);
260 out.push_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push_str().(pad_line.trim_endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_end().());
261 out.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]push().('\n');
262 need_extra_pad_line = false;
263 }
264
265 if need_extra_pad_line {
266 self.extra_pad_linerust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/AsciiLargeRenderer#extra_pad_line. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(base_pad_line);
267 }
268
269 out
270 }
271 }
272
273 #[cfg(test)]
274 mod testsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/ {
275 use superrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/::superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/;
276 use superrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/::superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::TestFixturerust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/TestFixture#;
277 use superrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/::superrust-analyzer cargo esl01-renderdag 0.3.0 crate/::test_utilsrust-analyzer cargo esl01-renderdag 0.3.0 test_utils/::render_stringrust-analyzer cargo esl01-renderdag 0.3.0 test_utils/render_string().;
278 use craterust-analyzer cargo esl01-renderdag 0.3.0 crate/::GraphRowRendererrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#;
279
280 fn renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(fixture: &TestFixturerust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/TestFixture#) -> Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String# {
281 let mut renderer = GraphRowRendererrust-analyzer cargo esl01-renderdag 0.3.0 render/GraphRowRenderer#::newrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`]new().()
282 .outputrust-analyzer cargo esl01-renderdag 0.3.0 render/impl#[`GraphRowRenderer<N>`]output().()
283 .with_min_row_heightrust-analyzer cargo esl01-renderdag 0.3.0 output/impl#[`OutputRendererBuilder<N, R>`]with_min_row_height().(3)
284 .build_ascii_largerust-analyzer cargo esl01-renderdag 0.3.0 output/impl#[`OutputRendererBuilder<N, R>`]build_ascii_large().();
285 render_stringrust-analyzer cargo esl01-renderdag 0.3.0 test_utils/render_string().(fixture, &mut renderer)
286 }
287
288 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
289 fn basicrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/basic().() {
290 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
291 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::BASICrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/BASIC.),
292 r#"
293 o C
294 |
295 |
296 o B
297 |
298 |
299 o A"#
300 );
301 }
302
303 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
304 fn branches_and_mergesrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/branches_and_merges().() {
305 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
306 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::BRANCHES_AND_MERGESrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/BRANCHES_AND_MERGES.),
307 r#"
308 o W
309 |
310 |
311 o V
312 |\
313 | \
314 | o U
315 | |\
316 | | \
317 | | o T
318 | | |
319 | | |
320 | o | S
321 | |
322 | |
323 o | R
324 | |
325 | |
326 o | Q
327 |\ |
328 | \ |
329 | o | P
330 | |\_|_
331 | | | \
332 | | | o O
333 | | | |
334 | | | |
335 | | | o N
336 | | | |\
337 | | | | \
338 | o | | | M
339 | | | | |
340 | | | | |
341 | o | | | L
342 | | | | |
343 | | | | |
344 o | | | | K
345 | _|__|__|_/
346 |/ | | |
347 o | | | J
348 | | | |
349 | | | |
350 o | | | I
351 | / | |
352 |/ | |
353 o | | H
354 | | |
355 | | |
356 o | | G
357 |\____|_ |
358 | | \|
359 | | o F
360 | | /
361 | |/
362 | o E
363 | |
364 | |
365 o | D
366 | |
367 | |
368 o | C
369 | ___/
370 |/
371 o B
372 |
373 |
374 o A"#
375 );
376 }
377
378 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
379 fn octopus_branch_and_mergerust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/octopus_branch_and_merge().() {
380 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
381 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::OCTOPUS_BRANCH_AND_MERGErust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/OCTOPUS_BRANCH_AND_MERGE.),
382 r#"
383 o J
384 |\___
385 | \ \
386 | | o I
387 | | |
388 | | |
389 | o | H
390 | /|\_|____
391 |/ | \| \ \
392 | | | | o G
393 | | | | |
394 | | | | |
395 | | | o | E
396 | | | | /
397 | | | |/
398 | | o | D
399 | | |\ |
400 | | | \|
401 | o | | C
402 | | _|_/
403 | |/ |
404 o | | F
405 | / |
406 |/ |
407 o | B
408 | ___/
409 |/
410 o A"#
411 );
412 }
413
414 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
415 fn reserved_columnrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/reserved_column().() {
416 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
417 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::RESERVED_COLUMNrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/RESERVED_COLUMN.),
418 r#"
419 o Z
420 |
421 |
422 o Y
423 |
424 |
425 o X
426 /
427 /
428 | o W
429 | /
430 |/
431 o G
432 |
433 |
434 o F
435 |\
436 | \
437 | o E
438 | |
439 | |
440 | o D
441 |
442 |
443 o C
444 |
445 |
446 o B
447 |
448 |
449 o A"#
450 );
451 }
452
453 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
454 fn ancestorsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/ancestors().() {
455 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
456 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::ANCESTORSrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/ANCESTORS.),
457 r#"
458 o Z
459 |
460 |
461 o Y
462 /
463 /
464 o F
465 .
466 .
467 . o X
468 . /
469 ./
470 | o W
471 | /
472 |/
473 o E
474 .
475 .
476 o D
477 |.
478 | .
479 | o C
480 | .
481 | .
482 o . B
483 | .
484 |.
485 o A"#
486 );
487 }
488
489 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
490 fn split_parentsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/split_parents().() {
491 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
492 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::SPLIT_PARENTSrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/SPLIT_PARENTS.),
493 r#"
494 o E
495 ...___/.
496 . / / .
497 . o | . D
498 . / \ | .
499 ./ \| .
500 | o . C
501 | | .
502 | |.
503 o | B
504 | ___/
505 |/
506 o A"#
507 );
508 }
509
510 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
511 fn terminationsrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/terminations().() {
512 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
513 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::TERMINATIONSrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/TERMINATIONS.),
514 r#"
515 o K
516 |
517 |
518 | o J
519 | /
520 |/
521 o I
522 /|\
523 / | \
524 | | |
525 | ~ |
526 | |
527 o | E
528 | |
529 | |
530 | o H
531 | ___/
532 |/
533 o D
534 |
535 ~
536
537 o C
538 |
539 |
540 o B
541 |
542 ~"#
543 );
544 }
545
546 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
547 fn long_messagesrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/long_messages().() {
548 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
549 renderrust-analyzer cargo esl01-renderdag 0.3.0 ascii_large/tests/render().(&test_fixturesrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/::LONG_MESSAGESrust-analyzer cargo esl01-renderdag 0.3.0 test_fixtures/LONG_MESSAGES.),
550 r#"
551 o F
552 |\___ very long message 1
553 | \ \ very long message 2
554 | | | very long message 3
555 | | ~
556 | | very long message 4
557 | | very long message 5
558 | | very long message 6
559 | |
560 | o E
561 | |
562 | |
563 | o D
564 | |
565 | |
566 o | C
567 | / long message 1
568 |/ long message 2
569 | long message 3
570 |
571 o B
572 |
573 |
574 o A
575 | long message 1
576 ~ long message 2
577 long message 3"#
578 );
579 }
580 }