Macro test_table

Source
macro_rules! test_table {
    ($test:ident, $table:expr, $($line:expr)*) => { ... };
    ($test:ident, $table:expr, $expected:expr,) => { ... };
}
Expand description

Create a test function for table assertion.

§Example


use tabled::Table;
use tabled::assert::test_table;

test_table!(
    test_table,
    Table::new([[1, 2, 3], [4, 5, 6]]),
    "+---+---+---+"
    "| 0 | 1 | 2 |"
    "+---+---+---+"
    "| 1 | 2 | 3 |"
    "+---+---+---+"
    "| 4 | 5 | 6 |"
    "+---+---+---+"
);

Create a test for a given table.

§Example

test_table!(
    test_name,
    Table::new([[1, 2, 3], [4, 5, 6]]),
    "|--|--|"
    "|XX|XY|"
    "|--|--|"
)
test_table!(
    test_name,
    Table::new([[1, 2, 3], [4, 5, 6]]), // got
    Table::new([[1, 2, 3], [4, 5, 6]]), // expected
)