| skipped 17 lines |
18 | 18 | | "image" |
19 | 19 | | "testing" |
20 | 20 | | |
21 | | - | "github.com/mum4k/termdash/internal/align" |
| 21 | + | "github.com/mum4k/termdash/align" |
| 22 | + | "github.com/mum4k/termdash/cell" |
22 | 23 | | "github.com/mum4k/termdash/internal/canvas" |
23 | 24 | | "github.com/mum4k/termdash/internal/canvas/testcanvas" |
24 | | - | "github.com/mum4k/termdash/internal/cell" |
25 | | - | "github.com/mum4k/termdash/internal/terminal/faketerm" |
| 25 | + | "github.com/mum4k/termdash/internal/faketerm" |
| 26 | + | "github.com/mum4k/termdash/linestyle" |
26 | 27 | | ) |
27 | 28 | | |
28 | 29 | | func TestBorder(t *testing.T) { |
| skipped 28 lines |
57 | 58 | | canvas: image.Rect(0, 0, 4, 4), |
58 | 59 | | border: image.Rect(0, 0, 2, 2), |
59 | 60 | | opts: []BorderOption{ |
60 | | - | BorderLineStyle(LineStyle(-1)), |
| 61 | + | BorderLineStyle(linestyle.LineStyle(-1)), |
61 | 62 | | }, |
62 | 63 | | want: func(size image.Point) *faketerm.Terminal { |
63 | 64 | | return faketerm.MustNew(size) |
| skipped 8 lines |
72 | 73 | | ft := faketerm.MustNew(size) |
73 | 74 | | c := testcanvas.MustNew(ft.Area()) |
74 | 75 | | |
75 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
76 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
77 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
78 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 76 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 77 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 78 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 79 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
79 | 80 | | |
80 | | - | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleLight][hLine]) |
81 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 81 | + | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 82 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
82 | 83 | | |
83 | | - | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleLight][hLine]) |
84 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 84 | + | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 85 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
85 | 86 | | |
86 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
87 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine]) |
88 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine]) |
89 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 87 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 88 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 89 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 90 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
90 | 91 | | |
91 | 92 | | testcanvas.MustApply(c, ft) |
92 | 93 | | return ft |
| skipped 4 lines |
97 | 98 | | canvas: image.Rect(0, 0, 4, 4), |
98 | 99 | | border: image.Rect(0, 0, 4, 4), |
99 | 100 | | opts: []BorderOption{ |
100 | | - | BorderLineStyle(LineStyleDouble), |
| 101 | + | BorderLineStyle(linestyle.Double), |
101 | 102 | | }, |
102 | 103 | | want: func(size image.Point) *faketerm.Terminal { |
103 | 104 | | ft := faketerm.MustNew(size) |
104 | 105 | | c := testcanvas.MustNew(ft.Area()) |
105 | 106 | | |
106 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleDouble][topLeftCorner]) |
107 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleDouble][vLine]) |
108 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleDouble][vLine]) |
109 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleDouble][bottomLeftCorner]) |
| 107 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Double][topLeftCorner]) |
| 108 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Double][vLine]) |
| 109 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Double][vLine]) |
| 110 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Double][bottomLeftCorner]) |
110 | 111 | | |
111 | | - | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleDouble][hLine]) |
112 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleDouble][hLine]) |
| 112 | + | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Double][hLine]) |
| 113 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Double][hLine]) |
113 | 114 | | |
114 | | - | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleDouble][hLine]) |
115 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleDouble][hLine]) |
| 115 | + | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Double][hLine]) |
| 116 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Double][hLine]) |
116 | 117 | | |
117 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleDouble][topRightCorner]) |
118 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleDouble][vLine]) |
119 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleDouble][vLine]) |
120 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleDouble][bottomRightCorner]) |
| 118 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Double][topRightCorner]) |
| 119 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Double][vLine]) |
| 120 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Double][vLine]) |
| 121 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Double][bottomRightCorner]) |
121 | 122 | | |
122 | 123 | | testcanvas.MustApply(c, ft) |
123 | 124 | | return ft |
| skipped 4 lines |
128 | 129 | | canvas: image.Rect(0, 0, 4, 4), |
129 | 130 | | border: image.Rect(0, 0, 4, 4), |
130 | 131 | | opts: []BorderOption{ |
131 | | - | BorderLineStyle(LineStyleRound), |
| 132 | + | BorderLineStyle(linestyle.Round), |
132 | 133 | | }, |
133 | 134 | | want: func(size image.Point) *faketerm.Terminal { |
134 | 135 | | ft := faketerm.MustNew(size) |
135 | 136 | | c := testcanvas.MustNew(ft.Area()) |
136 | 137 | | |
137 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleRound][topLeftCorner]) |
138 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleRound][vLine]) |
139 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleRound][vLine]) |
140 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleRound][bottomLeftCorner]) |
| 138 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Round][topLeftCorner]) |
| 139 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Round][vLine]) |
| 140 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Round][vLine]) |
| 141 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Round][bottomLeftCorner]) |
141 | 142 | | |
142 | | - | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleRound][hLine]) |
143 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleRound][hLine]) |
| 143 | + | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Round][hLine]) |
| 144 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Round][hLine]) |
144 | 145 | | |
145 | | - | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleRound][hLine]) |
146 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleRound][hLine]) |
| 146 | + | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Round][hLine]) |
| 147 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Round][hLine]) |
147 | 148 | | |
148 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleRound][topRightCorner]) |
149 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleRound][vLine]) |
150 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleRound][vLine]) |
151 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleRound][bottomRightCorner]) |
| 149 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Round][topRightCorner]) |
| 150 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Round][vLine]) |
| 151 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Round][vLine]) |
| 152 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Round][bottomRightCorner]) |
152 | 153 | | |
153 | 154 | | testcanvas.MustApply(c, ft) |
154 | 155 | | return ft |
| skipped 7 lines |
162 | 163 | | ft := faketerm.MustNew(size) |
163 | 164 | | c := testcanvas.MustNew(ft.Area()) |
164 | 165 | | |
165 | | - | testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[LineStyleLight][topLeftCorner]) |
166 | | - | testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 166 | + | testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 167 | + | testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
167 | 168 | | |
168 | | - | testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[LineStyleLight][topRightCorner]) |
169 | | - | testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 169 | + | testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 170 | + | testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
170 | 171 | | |
171 | 172 | | testcanvas.MustApply(c, ft) |
172 | 173 | | return ft |
| skipped 11 lines |
184 | 185 | | c := testcanvas.MustNew(ft.Area()) |
185 | 186 | | |
186 | 187 | | testcanvas.MustSetCell(c, image.Point{1, 1}, |
187 | | - | lineStyleChars[LineStyleLight][topLeftCorner], cell.FgColor(cell.ColorRed)) |
| 188 | + | lineStyleChars[linestyle.Light][topLeftCorner], cell.FgColor(cell.ColorRed)) |
188 | 189 | | testcanvas.MustSetCell(c, image.Point{1, 2}, |
189 | | - | lineStyleChars[LineStyleLight][bottomLeftCorner], cell.FgColor(cell.ColorRed)) |
| 190 | + | lineStyleChars[linestyle.Light][bottomLeftCorner], cell.FgColor(cell.ColorRed)) |
190 | 191 | | |
191 | 192 | | testcanvas.MustSetCell(c, image.Point{2, 1}, |
192 | | - | lineStyleChars[LineStyleLight][topRightCorner], cell.FgColor(cell.ColorRed)) |
| 193 | + | lineStyleChars[linestyle.Light][topRightCorner], cell.FgColor(cell.ColorRed)) |
193 | 194 | | testcanvas.MustSetCell(c, image.Point{2, 2}, |
194 | | - | lineStyleChars[LineStyleLight][bottomRightCorner], cell.FgColor(cell.ColorRed)) |
| 195 | + | lineStyleChars[linestyle.Light][bottomRightCorner], cell.FgColor(cell.ColorRed)) |
195 | 196 | | |
196 | 197 | | testcanvas.MustApply(c, ft) |
197 | 198 | | return ft |
| skipped 10 lines |
208 | 209 | | ft := faketerm.MustNew(size) |
209 | 210 | | c := testcanvas.MustNew(ft.Area()) |
210 | 211 | | |
211 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
212 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
213 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
214 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 212 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 213 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 214 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 215 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
215 | 216 | | |
216 | 217 | | testcanvas.MustSetCell(c, image.Point{1, 0}, 'a') |
217 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 218 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
218 | 219 | | |
219 | 220 | | testcanvas.MustSetCell(c, image.Point{2, 0}, 'b') |
220 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 221 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
221 | 222 | | |
222 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
223 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine]) |
224 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine]) |
225 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 223 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 224 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 225 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 226 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
226 | 227 | | |
227 | 228 | | testcanvas.MustApply(c, ft) |
228 | 229 | | return ft |
| skipped 10 lines |
239 | 240 | | ft := faketerm.MustNew(size) |
240 | 241 | | c := testcanvas.MustNew(ft.Area()) |
241 | 242 | | |
242 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
243 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
244 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
245 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 243 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 244 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 245 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 246 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
246 | 247 | | |
247 | 248 | | testcanvas.MustSetCell(c, image.Point{1, 0}, 'a', cell.FgColor(cell.ColorRed)) |
248 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 249 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
249 | 250 | | |
250 | 251 | | testcanvas.MustSetCell(c, image.Point{2, 0}, 'b', cell.FgColor(cell.ColorRed)) |
251 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 252 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
252 | 253 | | |
253 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
254 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine]) |
255 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine]) |
256 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 254 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 255 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 256 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 257 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
257 | 258 | | |
258 | 259 | | testcanvas.MustApply(c, ft) |
259 | 260 | | return ft |
| skipped 22 lines |
282 | 283 | | ft := faketerm.MustNew(size) |
283 | 284 | | c := testcanvas.MustNew(ft.Area()) |
284 | 285 | | |
285 | | - | testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[LineStyleLight][topLeftCorner]) |
286 | | - | testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 286 | + | testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 287 | + | testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
287 | 288 | | |
288 | | - | testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[LineStyleLight][topRightCorner]) |
289 | | - | testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 289 | + | testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 290 | + | testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
290 | 291 | | |
291 | 292 | | testcanvas.MustApply(c, ft) |
292 | 293 | | return ft |
| skipped 10 lines |
303 | 304 | | ft := faketerm.MustNew(size) |
304 | 305 | | c := testcanvas.MustNew(ft.Area()) |
305 | 306 | | |
306 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
307 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
308 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
309 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 307 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 308 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 309 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 310 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
310 | 311 | | |
311 | 312 | | testcanvas.MustSetCell(c, image.Point{1, 0}, 'a') |
312 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 313 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
313 | 314 | | |
314 | 315 | | testcanvas.MustSetCell(c, image.Point{2, 0}, 'b') |
315 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 316 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
316 | 317 | | |
317 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
318 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine]) |
319 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine]) |
320 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 318 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 319 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 320 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 321 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
321 | 322 | | |
322 | 323 | | testcanvas.MustApply(c, ft) |
323 | 324 | | return ft |
| skipped 10 lines |
334 | 335 | | ft := faketerm.MustNew(size) |
335 | 336 | | c := testcanvas.MustNew(ft.Area()) |
336 | 337 | | |
337 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
338 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
339 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
340 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 338 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 339 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 340 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 341 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
341 | 342 | | |
342 | 343 | | testcanvas.MustSetCell(c, image.Point{1, 0}, 'a') |
343 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 344 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
344 | 345 | | |
345 | 346 | | testcanvas.MustSetCell(c, image.Point{2, 0}, '…') |
346 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 347 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
347 | 348 | | |
348 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
349 | | - | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine]) |
350 | | - | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine]) |
351 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 349 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 350 | + | testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 351 | + | testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 352 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
352 | 353 | | |
353 | 354 | | testcanvas.MustApply(c, ft) |
354 | 355 | | return ft |
| skipped 11 lines |
366 | 367 | | ft := faketerm.MustNew(size) |
367 | 368 | | c := testcanvas.MustNew(ft.Area()) |
368 | 369 | | |
369 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
370 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
371 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
372 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 370 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 371 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 372 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 373 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
373 | 374 | | |
374 | 375 | | testcanvas.MustSetCell(c, image.Point{1, 0}, 'a') |
375 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 376 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
376 | 377 | | |
377 | 378 | | testcanvas.MustSetCell(c, image.Point{2, 0}, 'b') |
378 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 379 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
379 | 380 | | |
380 | | - | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][hLine]) |
381 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 381 | + | testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 382 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][hLine]) |
382 | 383 | | |
383 | | - | testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[LineStyleLight][hLine]) |
384 | | - | testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 384 | + | testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 385 | + | testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[linestyle.Light][hLine]) |
385 | 386 | | |
386 | | - | testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
387 | | - | testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[LineStyleLight][vLine]) |
388 | | - | testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[LineStyleLight][vLine]) |
389 | | - | testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 387 | + | testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 388 | + | testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 389 | + | testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 390 | + | testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
390 | 391 | | |
391 | 392 | | testcanvas.MustApply(c, ft) |
392 | 393 | | return ft |
| skipped 11 lines |
404 | 405 | | ft := faketerm.MustNew(size) |
405 | 406 | | c := testcanvas.MustNew(ft.Area()) |
406 | 407 | | |
407 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
408 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
409 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
410 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 408 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 409 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 410 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 411 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
411 | 412 | | |
412 | | - | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleLight][hLine]) |
413 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 413 | + | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 414 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
414 | 415 | | |
415 | 416 | | testcanvas.MustSetCell(c, image.Point{2, 0}, 'a') |
416 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 417 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
417 | 418 | | |
418 | 419 | | testcanvas.MustSetCell(c, image.Point{3, 0}, 'b') |
419 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 420 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][hLine]) |
420 | 421 | | |
421 | | - | testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[LineStyleLight][hLine]) |
422 | | - | testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 422 | + | testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 423 | + | testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[linestyle.Light][hLine]) |
423 | 424 | | |
424 | | - | testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
425 | | - | testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[LineStyleLight][vLine]) |
426 | | - | testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[LineStyleLight][vLine]) |
427 | | - | testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 425 | + | testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 426 | + | testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 427 | + | testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 428 | + | testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
428 | 429 | | |
429 | 430 | | testcanvas.MustApply(c, ft) |
430 | 431 | | return ft |
| skipped 11 lines |
442 | 443 | | ft := faketerm.MustNew(size) |
443 | 444 | | c := testcanvas.MustNew(ft.Area()) |
444 | 445 | | |
445 | | - | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner]) |
446 | | - | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine]) |
447 | | - | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine]) |
448 | | - | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner]) |
| 446 | + | testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner]) |
| 447 | + | testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 448 | + | testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 449 | + | testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner]) |
449 | 450 | | |
450 | | - | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleLight][hLine]) |
451 | | - | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 451 | + | testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 452 | + | testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine]) |
452 | 453 | | |
453 | | - | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleLight][hLine]) |
454 | | - | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 454 | + | testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Light][hLine]) |
| 455 | + | testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine]) |
455 | 456 | | |
456 | 457 | | testcanvas.MustSetCell(c, image.Point{3, 0}, 'a') |
457 | | - | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 458 | + | testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][hLine]) |
458 | 459 | | |
459 | 460 | | testcanvas.MustSetCell(c, image.Point{4, 0}, 'b') |
460 | | - | testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[LineStyleLight][hLine]) |
| 461 | + | testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[linestyle.Light][hLine]) |
461 | 462 | | |
462 | | - | testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[LineStyleLight][topRightCorner]) |
463 | | - | testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[LineStyleLight][vLine]) |
464 | | - | testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[LineStyleLight][vLine]) |
465 | | - | testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[LineStyleLight][bottomRightCorner]) |
| 463 | + | testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[linestyle.Light][topRightCorner]) |
| 464 | + | testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[linestyle.Light][vLine]) |
| 465 | + | testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[linestyle.Light][vLine]) |
| 466 | + | testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[linestyle.Light][bottomRightCorner]) |
466 | 467 | | |
467 | 468 | | testcanvas.MustApply(c, ft) |
468 | 469 | | return ft |
| skipped 35 lines |