Macro assert_table

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

Assert a table.

It’s an analog of assert_eq but for tables.

§Example

use tabled::Table;
use tabled::assert::assert_table;

let data = [[1, 2, 3], [4, 5, 6]];
let table = Table::new(data);

assert_table!(
    table,
    "+---+---+---+"
    "| 0 | 1 | 2 |"
    "+---+---+---+"
    "| 1 | 2 | 3 |"
    "+---+---+---+"
    "| 4 | 5 | 6 |"
    "+---+---+---+"
);

Assert a given table.

§Example

assert_table!(
    Table::new([[1, 2, 3], [4, 5, 6]]),
    "|--|--|"
    "|XX|XY|"
    "|--|--|"
)