| 1 | use comfy_tablerust-analyzer cargo comfy-table 7.2.2 crate/::*; |
| 2 | use pretty_assertionsrust-analyzer cargo pretty_assertions 1.4.1 crate/::assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!; |
| 3 | |
| 4 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 5 | fn test_col_count_headerrust-analyzer cargo comfy-table 7.2.2 all/counts/test_col_count_header().() { |
| 6 | let mut table = Tablerust-analyzer cargo comfy-table 7.2.2 table/Table#::newrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]new().(); |
| 7 | |
| 8 | table.set_headerrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]set_header().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Col 1", "Col 2", "Col 3"]); |
| 9 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.column_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]column_count().(), 3); |
| 10 | |
| 11 | table.set_headerrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]set_header().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Col 1", "Col 2", "Col 3", "Col 4"]); |
| 12 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.column_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]column_count().(), 4); |
| 13 | |
| 14 | table.set_headerrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]set_header().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Col I", "Col II"]); |
| 15 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.column_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]column_count().(), 4); |
| 16 | } |
| 17 | |
| 18 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 19 | fn test_col_count_rowrust-analyzer cargo comfy-table 7.2.2 all/counts/test_col_count_row().() { |
| 20 | let mut table = Tablerust-analyzer cargo comfy-table 7.2.2 table/Table#::newrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]new().(); |
| 21 | |
| 22 | table.add_rowrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Foo", "Bar"]); |
| 23 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.column_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]column_count().(), 2); |
| 24 | |
| 25 | table.add_rowrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Bar", "Foo", "Baz"]); |
| 26 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.column_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]column_count().(), 3); |
| 27 | } |
| 28 | |
| 29 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 30 | fn test_row_countrust-analyzer cargo comfy-table 7.2.2 all/counts/test_row_count().() { |
| 31 | let mut table = Tablerust-analyzer cargo comfy-table 7.2.2 table/Table#::newrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]new().(); |
| 32 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.row_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]row_count().(), 0); |
| 33 | |
| 34 | table.add_rowrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Foo", "Bar"]); |
| 35 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.row_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]row_count().(), 1); |
| 36 | |
| 37 | table.add_rowrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Bar", "Foo", "Baz"]); |
| 38 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.row_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]row_count().(), 2); |
| 39 | |
| 40 | table.add_row_ifrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row_if().(|_, _| false, vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Baz", "Bar", "Foo"]); |
| 41 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.row_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]row_count().(), 2); |
| 42 | |
| 43 | table.add_row_ifrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row_if().(|_, _| true, vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Foo", "Baz", "Bar"]); |
| 44 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.row_countrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]row_count().(), 3); |
| 45 | } |
| 46 | |
| 47 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 48 | fn test_is_emptyrust-analyzer cargo comfy-table 7.2.2 all/counts/test_is_empty().() { |
| 49 | let mut table = Tablerust-analyzer cargo comfy-table 7.2.2 table/Table#::newrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]new().(); |
| 50 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.is_emptyrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]is_empty().(), true); |
| 51 | |
| 52 | table.add_rowrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]add_row().(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["Foo", "Bar"]); |
| 53 | assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(table.is_emptyrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]is_empty().(), false); |
| 54 | } |