@@ -5,7 +5,6 @@ fn no_items() {
55 let grid = Grid :: new ( GridOptions {
66 direction : Direction :: TopToBottom ,
77 filling : Filling :: Spaces ( 2 ) ,
8- tab_size : 8 ,
98 } ) ;
109
1110 let display = grid. fit_into_width ( 40 ) . unwrap ( ) ;
@@ -17,7 +16,6 @@ fn one_item() {
1716 let mut grid = Grid :: new ( GridOptions {
1817 direction : Direction :: TopToBottom ,
1918 filling : Filling :: Spaces ( 2 ) ,
20- tab_size : 8 ,
2119 } ) ;
2220
2321 grid. add ( Cell :: from ( "1" ) ) ;
@@ -31,7 +29,6 @@ fn one_item_exact_width() {
3129 let mut grid = Grid :: new ( GridOptions {
3230 direction : Direction :: TopToBottom ,
3331 filling : Filling :: Spaces ( 2 ) ,
34- tab_size : 8 ,
3532 } ) ;
3633
3734 grid. add ( Cell :: from ( "1234567890" ) ) ;
@@ -45,7 +42,6 @@ fn one_item_just_over() {
4542 let mut grid = Grid :: new ( GridOptions {
4643 direction : Direction :: TopToBottom ,
4744 filling : Filling :: Spaces ( 2 ) ,
48- tab_size : 8 ,
4945 } ) ;
5046
5147 grid. add ( Cell :: from ( "1234567890!" ) ) ;
@@ -58,7 +54,6 @@ fn two_small_items() {
5854 let mut grid = Grid :: new ( GridOptions {
5955 direction : Direction :: TopToBottom ,
6056 filling : Filling :: Spaces ( 2 ) ,
61- tab_size : 8 ,
6257 } ) ;
6358
6459 grid. add ( Cell :: from ( "1" ) ) ;
@@ -75,7 +70,6 @@ fn two_medium_size_items() {
7570 let mut grid = Grid :: new ( GridOptions {
7671 direction : Direction :: TopToBottom ,
7772 filling : Filling :: Spaces ( 2 ) ,
78- tab_size : 8 ,
7973 } ) ;
8074
8175 grid. add ( Cell :: from ( "hello there" ) ) ;
@@ -92,7 +86,6 @@ fn two_big_items() {
9286 let mut grid = Grid :: new ( GridOptions {
9387 direction : Direction :: TopToBottom ,
9488 filling : Filling :: Spaces ( 2 ) ,
95- tab_size : 8 ,
9689 } ) ;
9790
9891 grid. add ( Cell :: from (
@@ -110,7 +103,6 @@ fn that_example_from_earlier() {
110103 let mut grid = Grid :: new ( GridOptions {
111104 filling : Filling :: Spaces ( 1 ) ,
112105 direction : Direction :: LeftToRight ,
113- tab_size : 8 ,
114106 } ) ;
115107
116108 for s in & [
@@ -130,7 +122,6 @@ fn number_grid_with_pipe() {
130122 let mut grid = Grid :: new ( GridOptions {
131123 filling : Filling :: Text ( "|" . into ( ) ) ,
132124 direction : Direction :: LeftToRight ,
133- tab_size : 8 ,
134125 } ) ;
135126
136127 for s in & [
@@ -150,7 +141,6 @@ fn huge_separator() {
150141 let mut grid = Grid :: new ( GridOptions {
151142 filling : Filling :: Spaces ( 100 ) ,
152143 direction : Direction :: LeftToRight ,
153- tab_size : 8 ,
154144 } ) ;
155145
156146 grid. add ( "a" . into ( ) ) ;
@@ -164,7 +154,6 @@ fn huge_yet_unused_separator() {
164154 let mut grid = Grid :: new ( GridOptions {
165155 filling : Filling :: Spaces ( 100 ) ,
166156 direction : Direction :: LeftToRight ,
167- tab_size : 8 ,
168157 } ) ;
169158
170159 grid. add ( "abcd" . into ( ) ) ;
@@ -183,7 +172,6 @@ fn emoji() {
183172 let mut grid = Grid :: new ( GridOptions {
184173 direction : Direction :: LeftToRight ,
185174 filling : Filling :: Spaces ( 2 ) ,
186- tab_size : 8 ,
187175 } ) ;
188176
189177 for s in [ "🦀" , "hello" , "👩🔬" , "hello" ] {
@@ -218,7 +206,6 @@ mod uutils_ls {
218206 let mut grid = Grid :: new ( GridOptions {
219207 direction : Direction :: TopToBottom ,
220208 filling : Filling :: Spaces ( 2 ) ,
221- tab_size : 8 ,
222209 } ) ;
223210
224211 for s in [
@@ -240,7 +227,6 @@ mod uutils_ls {
240227 let mut grid = Grid :: new ( GridOptions {
241228 direction : Direction :: LeftToRight ,
242229 filling : Filling :: Spaces ( 2 ) ,
243- tab_size : 8 ,
244230 } ) ;
245231
246232 for s in [
@@ -264,7 +250,6 @@ mod uutils_ls {
264250 let mut grid = Grid :: new ( GridOptions {
265251 direction : Direction :: TopToBottom ,
266252 filling : Filling :: Spaces ( 2 ) ,
267- tab_size : 8 ,
268253 } ) ;
269254
270255 for s in [
@@ -288,7 +273,6 @@ mod uutils_ls {
288273 let mut grid = Grid :: new ( GridOptions {
289274 direction : Direction :: TopToBottom ,
290275 filling : Filling :: Spaces ( 2 ) ,
291- tab_size : 8 ,
292276 } ) ;
293277
294278 for s in [ "a" , "b" , "a-long-name" , "z" ] {
@@ -304,7 +288,6 @@ mod uutils_ls {
304288 let mut grid = Grid :: new ( GridOptions {
305289 filling : Filling :: Spaces ( 10 ) ,
306290 direction : Direction :: LeftToRight ,
307- tab_size : 8 ,
308291 } ) ;
309292
310293 for s in & [
@@ -330,7 +313,6 @@ ten eleven twelve
330313 let mut grid = Grid :: new ( GridOptions {
331314 filling : Filling :: Spaces ( 30 ) ,
332315 direction : Direction :: LeftToRight ,
333- tab_size : 8 ,
334316 } ) ;
335317
336318 for s in & [
@@ -352,11 +334,10 @@ nine ten eleven twelve
352334 }
353335
354336 #[ test]
355- fn zero_tab_size ( ) {
337+ fn six_tabs_two_spaces ( ) {
356338 let mut grid = Grid :: new ( GridOptions {
357- filling : Filling :: Spaces ( 10 ) ,
339+ filling : Filling :: Spaces ( 50 ) ,
358340 direction : Direction :: LeftToRight ,
359- tab_size : 0 ,
360341 } ) ;
361342
362343 for s in & [
@@ -366,36 +347,12 @@ nine ten eleven twelve
366347 grid. add ( Cell :: from ( * s) ) ;
367348 }
368349
369- let display = grid. fit_into_width ( 50 ) . unwrap ( ) ;
370- assert_eq ! (
371- r"one two three four
372- five six seven eight
373- nine ten eleven twelve
374- " ,
375- display. to_string( )
376- ) ;
377- }
378-
379- #[ test]
380- fn negative_tab_size ( ) {
381- let mut grid = Grid :: new ( GridOptions {
382- filling : Filling :: Spaces ( 10 ) ,
383- direction : Direction :: LeftToRight ,
384- tab_size : -1 ,
385- } ) ;
386-
387- for s in & [
388- "one" , "two" , "three" , "four" , "five" , "six" , "seven" , "eight" , "nine" , "ten" ,
389- "eleven" , "twelve" ,
390- ] {
391- grid. add ( Cell :: from ( * s) ) ;
392- }
350+ let display = grid. fit_into_width ( 250 ) . unwrap ( ) ;
393351
394- let display = grid. fit_into_width ( 50 ) . unwrap ( ) ;
395352 assert_eq ! (
396- r"one two three four
397- five six seven eight
398- nine ten eleven twelve
353+ r"one two three four
354+ five six seven eight
355+ nine ten eleven twelve
399356" ,
400357 display. to_string( )
401358 ) ;
0 commit comments