Crate testing_table

Source
Expand description

Crate provides a convinient functions for work with tables.

use testing_table::test_table;

test_table!(
    test_tabled,
    tabled::Table::new([[1, 2, 3]]),
    "+---+---+---+"
    "| 0 | 1 | 2 |"
    "+---+---+---+"
    "| 1 | 2 | 3 |"
    "+---+---+---+"
);
use testing_table::assert_table;

assert_table!(
    tabled::Table::new([[1, 2, 3]]),
    "+---+---+---+"
    "| 0 | 1 | 2 |"
    "+---+---+---+"
    "| 1 | 2 | 3 |"
    "+---+---+---+"
);
use testing_table::static_table;

static_table!(
    "+---+---+---+"
    "| 0 | 1 | 2 |"
    "+---+---+---+"
    "| 1 | 2 | 3 |"
    "+---+---+---+"
);

It was developed as a sub-project of tabled.

Macros§

assert_table
Assert a given table.
assert_width
Assert a given table width.
static_table
Build a static table.
test_table
Create a test for a given table.

Functions§

get_char_width
Returns a char width.
get_line_width
Returns a string width.
get_string_width
Returns a string width (accouting all characters).
get_text_width
Returns a max string width of a line.