diff --git a/README.md b/README.md
index 1b4209d..f4e46ec 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,7 @@ Display data in a tabular form with Java
The data can be output in several different different forms:
* **text** - attractive ASCII format
+* **rich** - Unicode box drawing
* **csv** - comma separated values format
* **html** - HyperText Markup Language (HTML) format
* **json** - JavaScript Object Notation (JSON) format
@@ -38,7 +39,7 @@ import rickwporter.prettytable.PrettyTable.OutputFormat;
System.out.println(table.formattedString(OutputFormat.TEXT));
```
-You can use `PrettyTable::toString()` as an alternative to `PrettyTable::formattedString()`. If you want a format other than **text**, you can set it with `PrettyTable::setOutputFormat()`. Repeated leading cells in **text** and **html** follow `PrettyTable::setRemoveRedundant()`, which removes them by default. The code below would replace the `println()` call from above:
+You can use `PrettyTable::toString()` as an alternative to `PrettyTable::formattedString()`. If you want a format other than **text**, you can set it with `PrettyTable::setOutputFormat()`. Repeated leading cells in **text**, **rich**, and **html** follow `PrettyTable::setRemoveRedundant()`, which removes them by default. The code below would replace the `println()` call from above:
```Java
table.setOutputFormat(OutputFormat.HTML);
System.out.println(table.toString());
@@ -85,6 +86,22 @@ Using the **html** format (e.g. `OutputFormat.HTML`), you get the following outp
```
+Using the **rich** format (e.g. `OutputFormat.RICH`), you more aesthetically please lines for the table. The header (if shown) gets a heavier weight border. The header, border, row-divider, alignment, and deduplication settings are the same as **text**. Hiding the border (`setShowLines(false)`) leaves padded text, so a nested table stays borderless.
+
+```Java
+ System.out.println(table.formattedString(OutputFormat.RICH));
+```
+
+```
+┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━┓
+┃ Column A ┃ Column 2 ┃ Column III ┃
+┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━┩
+│ A │ B │ c │
+│ 1 │ 1024 │ 65535 │
+│ Washington │ Adams │ Jefferson │
+└────────────┴──────────┴────────────┘
+```
+
Using the **json** format (e.g. `OutputFormat.JSON`), you get the following output:
```
[
@@ -112,7 +129,7 @@ Using the **json** format (e.g. `OutputFormat.JSON`), you get the following outp
```
### Alignment
-Both ASCII **text** and **html** formats support different alignments. Here's how you would update the above table:
+ASCII **text**, **rich**, and **html** support different alignments. Here's how you would update the above table:
```Java
import rickwporter.prettytable.PrettyTable.HorizontalAlign;
@@ -140,7 +157,7 @@ The **html** output will have the appropriate `style="text-align:xxx"` attribute
```
### Text options
-ASCII **text** output can hide the header row, drop the border, draw a rule under data rows, and print a caption under the table. **csv**, **html**, and **json** ignore these settings.
+ASCII **text** and **rich** output can hide the header row, drop the border, draw a rule under data rows, and print a caption under the table. **csv**, **html**, and **json** ignore these settings. A `null` or empty caption is skipped. Any other caption is printed unchanged.
`PrettyTable::setShowHeader(false)` omits the header. Column widths then come only from the data cells, so the columns can get narrower. A table built with no headers already skips that row.
@@ -250,7 +267,7 @@ US presidents
```
### Deduplication
-Both ASCII **text** and **html** formats remove redundancy by default. This de-duplication generally makes the output more aesthetically pleasing, as demonstrated below.
+ASCII **text**, **rich**, and **html** remove redundancy by default. This de-duplication generally makes the output more aesthetically pleasing, as demonstrated below.
A table created like this:
```Java
@@ -342,6 +359,8 @@ import rickwporter.prettytable.TableBuilder;
Found 1 items
```
+`table.setOutputFormat(OutputFormat.RICH)` prints effectively the same table with prettier lines/borders.
+
### BuilderConfig
`BuilderConfig` holds the labels, caption, truncation limits, and column selection used by `build`. Each setter returns the config, so calls can be chained. A `null` config uses the defaults.
diff --git a/pom.xml b/pom.xml
index e6588b6..df33808 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,6 +12,7 @@
1.8
${java.version}
${java.version}
+ UTF-8
3.20.0
diff --git a/src/main/java/rickwporter/prettytable/PrettyTable.java b/src/main/java/rickwporter/prettytable/PrettyTable.java
index 684fe1d..be0a84a 100644
--- a/src/main/java/rickwporter/prettytable/PrettyTable.java
+++ b/src/main/java/rickwporter/prettytable/PrettyTable.java
@@ -26,6 +26,7 @@ public String getHtmlStyle() {
public enum OutputFormat {
TEXT,
+ RICH,
CSV,
HTML,
JSON,
@@ -211,6 +212,10 @@ String toText(boolean removeRedundant) {
return formattedString(OutputFormat.TEXT, removeRedundant);
}
+ String toRich(boolean removeRedundant) {
+ return formattedString(OutputFormat.RICH, removeRedundant);
+ }
+
String toCsv() {
return formattedString(OutputFormat.CSV, false);
}
@@ -231,6 +236,8 @@ public String formattedString(OutputFormat format, boolean removeRedundant) {
final TableRenderInterface renderer;
if (format == OutputFormat.TEXT) {
renderer = new TextTableRender();
+ } else if (format == OutputFormat.RICH) {
+ renderer = new RichTableRender();
} else if (format == OutputFormat.CSV) {
renderer = new CsvTableRender();
} else if (format == OutputFormat.JSON) {
diff --git a/src/main/java/rickwporter/prettytable/RichTableRender.java b/src/main/java/rickwporter/prettytable/RichTableRender.java
new file mode 100644
index 0000000..b976a95
--- /dev/null
+++ b/src/main/java/rickwporter/prettytable/RichTableRender.java
@@ -0,0 +1,56 @@
+package rickwporter.prettytable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import rickwporter.prettytable.PrettyTable.HorizontalAlign;
+
+class RichTableRender extends BaseTextTableRender {
+ // Four characters are left, fill, junction, right.
+ private static final TableGlyphs HEAVY_TOP = new TableGlyphs('┏', '━', '┳', '┓');
+ private static final TableGlyphs HEAVY_HEAD = new TableGlyphs('┡', '━', '╇', '┩');
+ private static final TableGlyphs HEAVY_VERT = new TableGlyphs('┃', ' ', '┃', '┃');
+ private static final TableGlyphs SQUARE_TOP = new TableGlyphs('┌', '─', '┬', '┐');
+ private static final TableGlyphs LIGHT_VERT = new TableGlyphs('│', ' ', '│', '│');
+ private static final TableGlyphs LIGHT_ROW = new TableGlyphs('├', '─', '┼', '┤');
+ private static final TableGlyphs LIGHT_BOTTOM = new TableGlyphs('└', '─', '┴', '┘');
+
+ @Override
+ public String render(PrettyTable table, boolean removeRedundant) {
+ List maxWidths = table.getMaxWidths();
+ boolean showLines = table.isShowLines();
+ boolean rowDividers = table.isRowDividers() && showLines;
+ boolean header = table.isShowHeader() && !table.getHeaders().isEmpty();
+ List hAligns = this.alignments(table);
+ StringBuilder result = new StringBuilder();
+
+ if (showLines && header) {
+ result.append(this.rule(HEAVY_TOP, maxWidths, true));
+ result.append(this.textRow(table.getHeaders(), maxWidths, hAligns, HEAVY_VERT));
+ result.append(this.rule(HEAVY_HEAD, maxWidths, true));
+ } else if (header) {
+ result.append(this.textRow(table.getHeaders(), maxWidths, hAligns, null));
+ } else if (showLines) {
+ result.append(this.rule(SQUARE_TOP, maxWidths, true));
+ }
+
+ List> rows = table.getRows();
+ List lastRow = new ArrayList();
+ for (int rIdx = 0; rIdx < rows.size(); rIdx++) {
+ List currentRow = this.cellText(rows.get(rIdx));
+ List fullRow = new ArrayList(currentRow);
+ boolean divider = true;
+ if (removeRedundant) {
+ divider = !this.sharesLeadingCells(lastRow, currentRow);
+ lastRow = fullRow;
+ }
+ TableGlyphs vertical = showLines ? LIGHT_VERT : null;
+ result.append(this.textRow(currentRow, maxWidths, hAligns, vertical));
+ boolean last = rIdx == rows.size() - 1;
+ result.append(this.rule(LIGHT_ROW, maxWidths, rowDividers && divider && !last));
+ }
+ result.append(this.rule(LIGHT_BOTTOM, maxWidths, showLines));
+ result.append(this.caption(table.getCaption()));
+ return result.toString();
+ }
+}
diff --git a/src/test/java/rickwporter/prettytable/PrettyTableTest.java b/src/test/java/rickwporter/prettytable/PrettyTableTest.java
index 0c2474e..f8a3b7d 100644
--- a/src/test/java/rickwporter/prettytable/PrettyTableTest.java
+++ b/src/test/java/rickwporter/prettytable/PrettyTableTest.java
@@ -16,6 +16,8 @@
public class PrettyTableTest {
Map OUTPUT_FORMAT_EXTENSIONS = new HashMap() {{
put(OutputFormat.TEXT, "text");
+ // NOTE: this is a little hacky, but named rich text as `txt` to distinguish from plain/ascii text
+ put(OutputFormat.RICH, "txt");
put(OutputFormat.CSV, "csv");
put(OutputFormat.HTML, "html");
put(OutputFormat.JSON, "json");
@@ -112,12 +114,30 @@ public void testBasicText() {
Assertions.assertEquals(expected, result);
}
+ @Test
+ public void testBasicRich() {
+ PrettyTable table = createBasicTable();
+ String result = table.toRich(true);
+ String expected = loadFileContent("PrettyTable_basic.txt");
+ Assertions.assertEquals(expected, result);
+ // same answer when going through 'formattedString()'
+ result = table.formattedString(OutputFormat.RICH);
+ Assertions.assertEquals(expected, result);
+ // same answer in this case because there are no duplicates
+ result = table.toRich(false);
+ Assertions.assertEquals(expected, result);
+ table.setOutputFormat(OutputFormat.RICH);
+ result = table.toString();
+ Assertions.assertEquals(expected, result);
+ }
+
@Test
public void testFormatted() {
// this checks all the formatted outputs
Map formats = new HashMap() {{
put(OutputFormat.HTML, "html");
put(OutputFormat.TEXT, "text");
+ put(OutputFormat.RICH, "txt");
}};
PrettyTable table = createFormattedTable();
for (Map.Entry entry: formats.entrySet()) {
@@ -179,6 +199,12 @@ public void testDuplicated() {
Assertions.assertEquals(expected, result);
result = table.formattedString(OutputFormat.TEXT, false);
Assertions.assertEquals(expected, result);
+
+ expected = loadFileContent("PrettyTable_duplicate_undup.txt");
+ result = table.toRich(false);
+ Assertions.assertEquals(expected, result);
+ result = table.formattedString(OutputFormat.RICH, false);
+ Assertions.assertEquals(expected, result);
expected = loadFileContent("PrettyTable_duplicate_undup.html");
result = table.toHtml(false);
@@ -201,6 +227,9 @@ public void testDuplicatedMixed() {
expected = loadFileContent("PrettyTable_duplicate_mixed.html");
Assertions.assertEquals(expected, table.formattedString(OutputFormat.HTML));
+
+ expected = loadFileContent("PrettyTable_duplicate_mixed.txt");
+ Assertions.assertEquals(expected, table.formattedString(OutputFormat.RICH));
}
@Test
@@ -326,6 +355,8 @@ public void testTextNewlines() {
String expected = loadFileContent("PrettyTable_newlines.text");
Assertions.assertEquals(expected, table.formattedString(OutputFormat.TEXT));
+ expected = loadFileContent("PrettyTable_newlines.txt");
+ Assertions.assertEquals(expected, table.formattedString(OutputFormat.RICH));
}
@Test
@@ -372,6 +403,12 @@ public void testNested() {
numbers.setOutputFormat(OutputFormat.CSV);
big.setOutputFormat(OutputFormat.JSON);
Assertions.assertEquals(expected, big.toString());
+
+ expected = loadFileContent("PrettyTable_nested_mixed.txt");
+ letters.setOutputFormat(OutputFormat.JSON);
+ numbers.setOutputFormat(OutputFormat.CSV);
+ big.setOutputFormat(OutputFormat.RICH);
+ Assertions.assertEquals(expected, big.toString());
}
@Test
@@ -498,29 +535,37 @@ public void testRemoveRedundantOption() {
table.addRow("A", "B", "F", "E");
String dedupedText = loadFileContent("PrettyTable_duplicate.text");
+ String dedupedRich = loadFileContent("PrettyTable_duplicate.txt");
String dedupedHtml = loadFileContent("PrettyTable_duplicate.html");
String fullText = loadFileContent("PrettyTable_duplicate_undup.text");
+ String fullRich = loadFileContent("PrettyTable_duplicate_undup.txt");
String fullHtml = loadFileContent("PrettyTable_duplicate_undup.html");
Assertions.assertTrue(table.isRemoveRedundant());
Assertions.assertEquals(dedupedText, table.formattedString(OutputFormat.TEXT));
+ Assertions.assertEquals(dedupedRich, table.formattedString(OutputFormat.RICH));
Assertions.assertEquals(dedupedHtml, table.formattedString(OutputFormat.HTML));
Assertions.assertEquals(dedupedText, table.toString());
table.setRemoveRedundant(false);
Assertions.assertFalse(table.isRemoveRedundant());
Assertions.assertEquals(fullText, table.formattedString(OutputFormat.TEXT));
+ Assertions.assertEquals(fullRich, table.formattedString(OutputFormat.RICH));
Assertions.assertEquals(fullHtml, table.formattedString(OutputFormat.HTML));
Assertions.assertEquals(fullText, table.toString());
table.setOutputFormat(OutputFormat.HTML);
Assertions.assertEquals(fullHtml, table.toString());
+ table.setOutputFormat(OutputFormat.RICH);
+ Assertions.assertEquals(fullRich, table.toString());
// the explicit flag still overrides the option
Assertions.assertEquals(dedupedText, table.formattedString(OutputFormat.TEXT, true));
+ Assertions.assertEquals(dedupedRich, table.formattedString(OutputFormat.RICH, true));
Assertions.assertEquals(dedupedHtml, table.formattedString(OutputFormat.HTML, true));
table.setRemoveRedundant(true);
Assertions.assertEquals(fullText, table.formattedString(OutputFormat.TEXT, false));
+ Assertions.assertEquals(fullRich, table.formattedString(OutputFormat.RICH, false));
Assertions.assertEquals(fullHtml, table.toHtml(false));
// CSV and JSON keep every value either way
diff --git a/src/test/java/rickwporter/prettytable/RichTableRenderTest.java b/src/test/java/rickwporter/prettytable/RichTableRenderTest.java
new file mode 100644
index 0000000..bdd0cd9
--- /dev/null
+++ b/src/test/java/rickwporter/prettytable/RichTableRenderTest.java
@@ -0,0 +1,378 @@
+package rickwporter.prettytable;
+
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import rickwporter.prettytable.PrettyTable.HorizontalAlign;
+import rickwporter.prettytable.PrettyTable.OutputFormat;
+
+public class RichTableRenderTest {
+ @Test
+ public void testBasicRich() {
+ PrettyTable table = new PrettyTable("Column A", "Column 2", "Column III");
+ table.addRow("A", "B", "c");
+ table.addRow(1, 1024, 65535);
+ table.addRow("Washington", "Adams", "Jefferson");
+
+ String expected = loadFileContent("PrettyTable_basic.txt");
+ Assertions.assertEquals(expected, render(table));
+ Assertions.assertEquals(expected, table.formattedString(OutputFormat.RICH));
+ Assertions.assertEquals(expected, table.toRich(true));
+
+ table.setOutputFormat(OutputFormat.RICH);
+ Assertions.assertEquals(OutputFormat.RICH, table.getDefaultOutput());
+ Assertions.assertEquals(expected, table.toString());
+ }
+
+ @Test
+ public void testAlignment() {
+ PrettyTable table = new PrettyTable("Column A", "Column 2", "Column III");
+ table.setHorizAligns(HorizontalAlign.LEFT, HorizontalAlign.CENTER, HorizontalAlign.RIGHT);
+ table.addRow("A", "B", "c");
+ table.addRow(1, 1024, 65535);
+ table.addRow("Washington", "Adams", "Jefferson");
+
+ Assertions.assertEquals(loadFileContent("PrettyTable_formatted.txt"), render(table));
+ }
+
+ @Test
+ public void testHiddenHeaderUsesSquareBox() {
+ PrettyTable table = nameAgeTable();
+ table.setShowHeader(false);
+ Assertions.assertEquals(""
+ + "┌─────┬────┐\n"
+ + "│ Ada │ 36 │\n"
+ + "│ Bob │ 7 │\n"
+ + "└─────┴────┘\n", render(table));
+
+ PrettyTable noHeaders = new PrettyTable();
+ noHeaders.addRow("Ada", 36);
+ Assertions.assertEquals(""
+ + "┌─────┬────┐\n"
+ + "│ Ada │ 36 │\n"
+ + "└─────┴────┘\n", render(noHeaders));
+
+ PrettyTable empty = new PrettyTable("Name", "Age");
+ empty.setShowHeader(false);
+ Assertions.assertEquals(""
+ + "┌──┬──┐\n"
+ + "└──┴──┘\n", render(empty));
+ }
+
+ @Test
+ public void testEmptyTableClosesTheBox() {
+ PrettyTable empty = new PrettyTable("Name", "Age");
+ Assertions.assertEquals(""
+ + "┏━━━━━━┳━━━━━┓\n"
+ + "┃ Name ┃ Age ┃\n"
+ + "┡━━━━━━╇━━━━━┩\n"
+ + "└──────┴─────┘\n", render(empty));
+
+ empty.setRowDividers(true);
+ Assertions.assertEquals(""
+ + "┏━━━━━━┳━━━━━┓\n"
+ + "┃ Name ┃ Age ┃\n"
+ + "┡━━━━━━╇━━━━━┩\n"
+ + "└──────┴─────┘\n", render(empty));
+ }
+
+ @Test
+ public void testShowLinesFalseMatchesText() {
+ PrettyTable table = nameAgeTable();
+ table.setShowLines(false);
+ Assertions.assertEquals(new TextTableRender().render(table, false), render(table));
+
+ table.setHorizAligns(HorizontalAlign.LEFT, HorizontalAlign.RIGHT);
+ Assertions.assertEquals(new TextTableRender().render(table, false), render(table));
+
+ table.setShowHeader(false);
+ table.setRowDividers(true);
+ Assertions.assertEquals(new TextTableRender().render(table, false), render(table));
+ }
+
+ @Test
+ public void testRowDividers() {
+ PrettyTable table = nameAgeTable();
+ table.setRowDividers(true);
+ Assertions.assertEquals(""
+ + "┏━━━━━━┳━━━━━┓\n"
+ + "┃ Name ┃ Age ┃\n"
+ + "┡━━━━━━╇━━━━━┩\n"
+ + "│ Ada │ 36 │\n"
+ + "├──────┼─────┤\n"
+ + "│ Bob │ 7 │\n"
+ + "└──────┴─────┘\n", render(table, false));
+
+ table.setShowHeader(false);
+ Assertions.assertEquals(""
+ + "┌─────┬────┐\n"
+ + "│ Ada │ 36 │\n"
+ + "├─────┼────┤\n"
+ + "│ Bob │ 7 │\n"
+ + "└─────┴────┘\n", render(table, false));
+
+ PrettyTable wrapped = new PrettyTable("A", "B");
+ wrapped.setRowDividers(true);
+ wrapped.addRow("a\nbb", "c");
+ wrapped.addRow("d", "ee");
+ Assertions.assertEquals(""
+ + "┏━━━━┳━━━━┓\n"
+ + "┃ A ┃ B ┃\n"
+ + "┡━━━━╇━━━━┩\n"
+ + "│ a │ c │\n"
+ + "│ bb │ │\n"
+ + "├────┼────┤\n"
+ + "│ d │ ee │\n"
+ + "└────┴────┘\n", render(wrapped, false));
+ }
+
+ @Test
+ public void testSharedPrefixOmitsInnerRules() {
+ PrettyTable table = new PrettyTable("Col1", "Col2", "Col3", "Col4");
+ table.addRow("A", "B", "C", "D");
+ table.addRow("A", "B", "C", "Z");
+ table.addRow("A", "B", "F", "E");
+ table.addRow("A", "B", "F", "E");
+ table.setRowDividers(true);
+
+ Assertions.assertEquals(""
+ + "┏━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━┓\n"
+ + "┃ Col1 ┃ Col2 ┃ Col3 ┃ Col4 ┃\n"
+ + "┡━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━┩\n"
+ + "│ A │ B │ C │ D │\n"
+ + "├──────┼──────┼──────┼──────┤\n"
+ + "│ │ │ │ Z │\n"
+ + "│ │ │ F │ E │\n"
+ + "│ │ │ │ │\n"
+ + "└──────┴──────┴──────┴──────┘\n", render(table, true));
+
+ Assertions.assertEquals(""
+ + "┏━━━━━━┳━━━━━━┳━━━━━━┳━━━━━━┓\n"
+ + "┃ Col1 ┃ Col2 ┃ Col3 ┃ Col4 ┃\n"
+ + "┡━━━━━━╇━━━━━━╇━━━━━━╇━━━━━━┩\n"
+ + "│ A │ B │ C │ D │\n"
+ + "├──────┼──────┼──────┼──────┤\n"
+ + "│ A │ B │ C │ Z │\n"
+ + "├──────┼──────┼──────┼──────┤\n"
+ + "│ A │ B │ F │ E │\n"
+ + "├──────┼──────┼──────┼──────┤\n"
+ + "│ A │ B │ F │ E │\n"
+ + "└──────┴──────┴──────┴──────┘\n", render(table, false));
+ }
+
+ @Test
+ public void testCaption() {
+ PrettyTable table = nameAgeTable();
+ Assertions.assertEquals(borderedNameAge(), render(table));
+
+ table.setCaption("");
+ Assertions.assertEquals(borderedNameAge(), render(table));
+
+ table.setCaption("Friends");
+ Assertions.assertEquals(borderedNameAge() + "Friends\n", render(table));
+ }
+
+ @Test
+ public void testNullAlignment() {
+ PrettyTable table = new PrettyTable("A");
+ table.addRow("x");
+ table.setHorizAligns((HorizontalAlign) null);
+ IllegalArgumentException ex = Assertions.assertThrows(
+ IllegalArgumentException.class,
+ () -> render(table)
+ );
+ Assertions.assertEquals("Unsupported HorizontalAlignment: null", ex.getMessage());
+ }
+
+ @Test
+ public void testNestedTableUsesItsOwnFormat() {
+ PrettyTable inner = new PrettyTable("A");
+ inner.addRow("hi");
+ inner.setOutputFormat(OutputFormat.RICH);
+ PrettyTable outer = new PrettyTable("Data");
+ outer.setHorizAligns(HorizontalAlign.LEFT);
+ outer.addRow(inner);
+
+ Assertions.assertEquals(""
+ + "┏━━━━━━━━┓\n"
+ + "┃ Data ┃\n"
+ + "┡━━━━━━━━┩\n"
+ + "│ ┏━━━━┓ │\n"
+ + "│ ┃ A ┃ │\n"
+ + "│ ┡━━━━┩ │\n"
+ + "│ │ hi │ │\n"
+ + "│ └────┘ │\n"
+ + "└────────┘\n", outer.formattedString(OutputFormat.RICH));
+
+ inner.setOutputFormat(OutputFormat.TEXT);
+ Assertions.assertTrue(outer.formattedString(OutputFormat.RICH).contains("| A |"));
+ }
+
+ @Test
+ public void testRichObjectsSamples() {
+ Assertions.assertEquals(""
+ + "┏━━━━━━┳━━━━━━━━━━━━━━━━┓\n"
+ + "┃ Name ┃ Properties ┃\n"
+ + "┡━━━━━━╇━━━━━━━━━━━━━━━━┩\n"
+ + "│ sna │ prop1 1 │\n"
+ + "│ │ prop B None │\n"
+ + "│ │ blah zay │\n"
+ + "├──────┼────────────────┤\n"
+ + "│ foo │ prop2 2 │\n"
+ + "│ │ prop B True │\n"
+ + "├──────┼────────────────┤\n"
+ + "│ bar │ 1 inverse │\n"
+ + "└──────┴────────────────┘\n"
+ + "Found 3 items\n",
+ rich(readmeList()));
+
+ Assertions.assertEquals(""
+ + "┏━━━━━━━━━━┳━━━━━━━━━━━━━━━┓\n"
+ + "┃ Property ┃ Value ┃\n"
+ + "┡━━━━━━━━━━╇━━━━━━━━━━━━━━━┩\n"
+ + "│ abc │ def │\n"
+ + "│ ghi │ False │\n"
+ + "│ jkl │ mno, pqr, stu │\n"
+ + "│ vwx │ 1, 2, 4 │\n"
+ + "│ 2 │ 3 │\n"
+ + "│ yxa │ None │\n"
+ + "└──────────┴───────────────┘\n",
+ rich(simpleDict()));
+
+ Assertions.assertEquals(""
+ + "┏━━━━━━━━━━━┓\n"
+ + "┃ Items ┃\n"
+ + "┡━━━━━━━━━━━┩\n"
+ + "│ str value │\n"
+ + "├───────────┤\n"
+ + "│ 3 │\n"
+ + "├───────────┤\n"
+ + "│ 4 │\n"
+ + "├───────────┤\n"
+ + "│ False │\n"
+ + "├───────────┤\n"
+ + "│ None │\n"
+ + "├───────────┤\n"
+ + "│ foo │\n"
+ + "└───────────┘\n"
+ + "Found 6 items\n",
+ rich(Arrays.asList("str value", "3", 4, false, null, "foo")));
+
+ List