@@ -105,11 +105,11 @@ public void prettyPrintPlanInformationWithNewlines() {
105105
106106 // THEN
107107 assertThat (actual , startsWith (String .join (NEWLINE ,
108- "+----------------------------------------------------------------------------------- +" ,
109- "| Plan | Statement | Version | Planner | Runtime | Time |" ,
110- "+----------------------------------------------------------------------------------- +" ,
111- "| \" EXPLAIN\" | \" READ_ONLY\" | \" 3.1\" | \" COST\" | \" INTERPRETED\" | 12 |" ,
112- "+----------------------------------------------------------------------------------- +" ,
108+ "+--------------------------------------------------------------------+" ,
109+ "| Plan | Statement | Version | Planner | Runtime | Time |" ,
110+ "+--------------------------------------------------------------------+" ,
111+ "| \" EXPLAIN\" | \" READ_ONLY\" | \" 3.1\" | \" COST\" | \" INTERPRETED\" | 12 |" ,
112+ "+--------------------------------------------------------------------+" ,
113113 NEWLINE )));
114114 }
115115
@@ -303,19 +303,33 @@ public void basicTable() {
303303 // WHEN
304304 String table = formatResult (result );
305305 // THEN
306- assertThat (table , containsString ("| c1 | c2 |" ));
307- assertThat (table , containsString ("| \" a\" | 42 |" ));
306+ assertThat (table , containsString ("| c1 | c2 |" ));
307+ assertThat (table , containsString ("| \" a\" | 42 |" ));
308308 }
309309
310310 @ Test
311- public void twoRows () {
311+ public void twoRowsWithNumbersAllSampled () {
312312 // GIVEN
313313 StatementResult result = mockResult (asList ("c1" , "c2" ), "a" , 42 , "b" , 43 );
314314 // WHEN
315315 String table = formatResult (result );
316316 // THEN
317- assertThat (table , containsString ("| \" a\" | 42 |" ));
318- assertThat (table , containsString ("| \" b\" | 43 |" ));
317+ assertThat (table , containsString ("| \" a\" | 42 |" ));
318+ assertThat (table , containsString ("| \" b\" | 43 |" ));
319+ }
320+
321+ @ Test
322+ public void fiveRowsWithNumbersNotAllSampled () {
323+ // GIVEN
324+ StatementResult result = mockResult (asList ("c1" , "c2" ), "a" , 42 , "b" , 43 , "c" , 44 , "d" , 45 , "e" , 46 );
325+ // WHEN
326+ String table = formatResult (result );
327+ // THEN
328+ assertThat (table , containsString ("| \" a\" | 42 |" ));
329+ assertThat (table , containsString ("| \" b\" | 43 |" ));
330+ assertThat (table , containsString ("| \" c\" | 44 |" ));
331+ assertThat (table , containsString ("| \" d\" | 45 |" ));
332+ assertThat (table , containsString ("| \" e\" | 46 |" ));
319333 }
320334
321335 @ Test
0 commit comments