#pretty-table #assert

no-std testing_table

An easy to use library for pretty print tables of Rust structs and enums

4 releases (2 breaking)

new 0.3.0 Apr 24, 2025
0.2.0 Nov 22, 2024
0.1.1 Aug 5, 2024
0.1.0 Aug 5, 2024

#556 in Testing

Download history 97/week @ 2025-01-04 712/week @ 2025-01-11 1075/week @ 2025-01-18 296/week @ 2025-01-25 1074/week @ 2025-02-01 104/week @ 2025-02-08 101/week @ 2025-02-15 297/week @ 2025-02-22 327/week @ 2025-03-01 215/week @ 2025-03-08 206/week @ 2025-03-15 239/week @ 2025-03-22 20/week @ 2025-03-29 90/week @ 2025-04-05 225/week @ 2025-04-12 591/week @ 2025-04-19

929 downloads per month
Used in 9 crates (2 directly)

MIT license

8KB
91 lines

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.


testing_table

A library which provides handy macros for table testing.

Includes

  • test_table!
  • static_table!
  • assert_table!
  • assert_width!
use testing_table::{test_table, assert_table, static_table};

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

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

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

Dependencies

~1.5MB
~25K SLoC