@@ -70,12 +70,12 @@ public void Column_width_definition_size_calculation_according_priority_fixed_th
7070
7171 var terminal = new TestTerminal ( ) ;
7272 var renderer = new ConsoleRenderer ( terminal , outputMode ) ;
73- grid . Render ( renderer , new Region ( 0 , 0 , 20 , 1 ) ) ;
73+ grid . Render ( renderer , new Region ( 0 , 0 , 22 , 1 ) ) ;
7474
7575 terminal . Events . Should ( ) . BeEquivalentSequenceTo (
7676 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
77- new TestTerminal . ContentWritten ( "brown fox " ) ,
78- new TestTerminal . CursorPositionChanged ( new Point ( 10 , 0 ) ) ,
77+ new TestTerminal . ContentWritten ( "brown fox" ) ,
78+ new TestTerminal . CursorPositionChanged ( new Point ( 11 , 0 ) ) ,
7979 new TestTerminal . ContentWritten ( "jumped " ) ) ;
8080 }
8181
@@ -109,6 +109,33 @@ public void Row_height_definition_size_calculation_according_priority_fixed_then
109109 new TestTerminal . ContentWritten ( " " ) ) ;
110110 }
111111
112+ [ Theory ]
113+ [ InlineData ( OutputMode . Ansi ) ]
114+ [ InlineData ( OutputMode . NonAnsi ) ]
115+ public void Column_width_definition_is_preserved_even_defintion_is_mixed_for_subsequent_columns2 ( OutputMode outputMode )
116+ {
117+ var grid = new GridView ( ) ;
118+ grid . SetColumns ( ColumnDefinition . Fixed ( 9 ) , ColumnDefinition . Star ( 1 ) , ColumnDefinition . SizeToContent ( ) , ColumnDefinition . Fixed ( 15 ) ) ;
119+ grid . SetChild ( new ContentView ( "The quick" ) , 0 , 0 ) ;
120+ grid . SetChild ( new ContentView ( "brown fox" ) , 1 , 0 ) ;
121+ grid . SetChild ( new ContentView ( "jumped" ) , 2 , 0 ) ;
122+ grid . SetChild ( new ContentView ( "over the sleepy" ) , 3 , 0 ) ;
123+
124+ var terminal = new TestTerminal ( ) ;
125+ var renderer = new ConsoleRenderer ( terminal , outputMode ) ;
126+ grid . Render ( renderer , new Region ( 0 , 0 , 45 , 1 ) ) ;
127+
128+ terminal . Events . Should ( ) . BeEquivalentSequenceTo (
129+ new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
130+ new TestTerminal . ContentWritten ( "The quick" ) ,
131+ new TestTerminal . CursorPositionChanged ( new Point ( 11 , 0 ) ) ,
132+ new TestTerminal . ContentWritten ( "brown fox" ) ,
133+ new TestTerminal . CursorPositionChanged ( new Point ( 22 , 0 ) ) ,
134+ new TestTerminal . ContentWritten ( "jumped" ) ,
135+ new TestTerminal . CursorPositionChanged ( new Point ( 30 , 0 ) ) ,
136+ new TestTerminal . ContentWritten ( "over the sleepy" ) ) ;
137+ }
138+
112139 [ Theory ]
113140 [ InlineData ( OutputMode . Ansi ) ]
114141 [ InlineData ( OutputMode . NonAnsi ) ]
@@ -123,16 +150,16 @@ public void Column_width_definition_is_preserved_even_defintion_is_mixed_for_sub
123150
124151 var terminal = new TestTerminal ( ) ;
125152 var renderer = new ConsoleRenderer ( terminal , outputMode ) ;
126- grid . Render ( renderer , new Region ( 0 , 0 , 115 , 1 ) ) ;
153+ grid . Render ( renderer , new Region ( 0 , 0 , 121 , 1 ) ) ;
127154
128155 terminal . Events . Should ( ) . BeEquivalentSequenceTo (
129156 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
130157 new TestTerminal . ContentWritten ( "The quick " ) ,
131- new TestTerminal . CursorPositionChanged ( new Point ( 10 , 0 ) ) ,
158+ new TestTerminal . CursorPositionChanged ( new Point ( 12 , 0 ) ) ,
132159 new TestTerminal . ContentWritten ( "brown fox" + new string ( ' ' , 71 ) ) ,
133- new TestTerminal . CursorPositionChanged ( new Point ( 90 , 0 ) ) ,
160+ new TestTerminal . CursorPositionChanged ( new Point ( 94 , 0 ) ) ,
134161 new TestTerminal . ContentWritten ( "jumped " ) ,
135- new TestTerminal . CursorPositionChanged ( new Point ( 100 , 0 ) ) ,
162+ new TestTerminal . CursorPositionChanged ( new Point ( 106 , 0 ) ) ,
136163 new TestTerminal . ContentWritten ( "over the sleepy" ) ) ;
137164 }
138165
@@ -151,24 +178,24 @@ public void Star_grid_lays_out_in_even_grid(OutputMode outputMode)
151178
152179 var terminal = new TestTerminal ( ) ;
153180 var renderer = new ConsoleRenderer ( terminal , outputMode ) ;
154- grid . Render ( renderer , new Region ( 0 , 0 , 10 , 4 ) ) ;
181+ grid . Render ( renderer , new Region ( 0 , 0 , 12 , 4 ) ) ;
155182
156183 terminal . Events . Should ( ) . BeEquivalentSequenceTo (
157184 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
158185 new TestTerminal . ContentWritten ( "The " ) ,
159186 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 1 ) ) ,
160187 new TestTerminal . ContentWritten ( "quick" ) ,
161- new TestTerminal . CursorPositionChanged ( new Point ( 5 , 0 ) ) ,
188+ new TestTerminal . CursorPositionChanged ( new Point ( 7 , 0 ) ) ,
162189 new TestTerminal . ContentWritten ( "brown" ) ,
163- new TestTerminal . CursorPositionChanged ( new Point ( 5 , 1 ) ) ,
190+ new TestTerminal . CursorPositionChanged ( new Point ( 7 , 1 ) ) ,
164191 new TestTerminal . ContentWritten ( "fox " ) ,
165192 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 2 ) ) ,
166193 new TestTerminal . ContentWritten ( "jumpe" ) ,
167194 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 3 ) ) ,
168195 new TestTerminal . ContentWritten ( " " ) ,
169- new TestTerminal . CursorPositionChanged ( new Point ( 5 , 2 ) ) ,
196+ new TestTerminal . CursorPositionChanged ( new Point ( 7 , 2 ) ) ,
170197 new TestTerminal . ContentWritten ( "over " ) ,
171- new TestTerminal . CursorPositionChanged ( new Point ( 5 , 3 ) ) ,
198+ new TestTerminal . CursorPositionChanged ( new Point ( 7 , 3 ) ) ,
172199 new TestTerminal . ContentWritten ( " " ) ) ;
173200 }
174201
@@ -187,22 +214,22 @@ public void Fixed_grid_lays_out_fixed_rows_and_columns(OutputMode outputMode)
187214
188215 var terminal = new TestTerminal ( ) ;
189216 var renderer = new ConsoleRenderer ( terminal , outputMode ) ;
190- grid . Render ( renderer , new Region ( 0 , 0 , 10 , 4 ) ) ;
217+ grid . Render ( renderer , new Region ( 0 , 0 , 12 , 4 ) ) ;
191218
192219 terminal . Events
193220 . Should ( )
194221 . BeEquivalentSequenceTo (
195222 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
196223 new TestTerminal . ContentWritten ( "The " ) ,
197- new TestTerminal . CursorPositionChanged ( new Point ( 6 , 0 ) ) ,
224+ new TestTerminal . CursorPositionChanged ( new Point ( 8 , 0 ) ) ,
198225 new TestTerminal . ContentWritten ( "brow" ) ,
199226 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 1 ) ) ,
200227 new TestTerminal . ContentWritten ( "jumped" ) ,
201228 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 2 ) ) ,
202229 new TestTerminal . ContentWritten ( "over " ) ,
203- new TestTerminal . CursorPositionChanged ( new Point ( 6 , 1 ) ) ,
230+ new TestTerminal . CursorPositionChanged ( new Point ( 8 , 1 ) ) ,
204231 new TestTerminal . ContentWritten ( "the " ) ,
205- new TestTerminal . CursorPositionChanged ( new Point ( 6 , 2 ) ) ,
232+ new TestTerminal . CursorPositionChanged ( new Point ( 8 , 2 ) ) ,
206233 new TestTerminal . ContentWritten ( "slee" ) ) ;
207234 }
208235
@@ -225,11 +252,11 @@ public void Size_to_content_grid_with_wide_region_adjusts_to_content_size(Output
225252
226253 terminal . Events . Should ( ) . BeEquivalentSequenceTo (
227254 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
228- new TestTerminal . ContentWritten ( "The quick " ) ,
255+ new TestTerminal . ContentWritten ( "The quick " ) ,
229256 new TestTerminal . CursorPositionChanged ( new Point ( 13 , 0 ) ) ,
230257 new TestTerminal . ContentWritten ( "brown fox " ) ,
231258 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 1 ) ) ,
232- new TestTerminal . ContentWritten ( "jumped over " ) ,
259+ new TestTerminal . ContentWritten ( "jumped over" ) ,
233260 new TestTerminal . CursorPositionChanged ( new Point ( 13 , 1 ) ) ,
234261 new TestTerminal . ContentWritten ( "the sleepy" ) ) ;
235262 }
@@ -253,15 +280,15 @@ public void Size_to_content_grid_with_narrow_region_increases_row_height(OutputM
253280
254281 terminal . Events . Should ( ) . BeEquivalentSequenceTo (
255282 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 0 ) ) ,
256- new TestTerminal . ContentWritten ( "The quick " ) ,
283+ new TestTerminal . ContentWritten ( "The quick " ) ,
257284 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 1 ) ) ,
258- new TestTerminal . ContentWritten ( " " ) ,
285+ new TestTerminal . ContentWritten ( " " ) ,
259286 new TestTerminal . CursorPositionChanged ( new Point ( 13 , 0 ) ) ,
260287 new TestTerminal . ContentWritten ( "brown" ) ,
261288 new TestTerminal . CursorPositionChanged ( new Point ( 13 , 1 ) ) ,
262289 new TestTerminal . ContentWritten ( "fox " ) ,
263290 new TestTerminal . CursorPositionChanged ( new Point ( 0 , 2 ) ) ,
264- new TestTerminal . ContentWritten ( "jumped over " ) ,
291+ new TestTerminal . ContentWritten ( "jumped over" ) ,
265292 new TestTerminal . CursorPositionChanged ( new Point ( 13 , 2 ) ) ,
266293 new TestTerminal . ContentWritten ( "the s" ) ) ;
267294 }
0 commit comments