Debian Codegraph @

tests/all/modifiers_test.rs

raw symbols SCIP
1 use comfy_tablerust-analyzer cargo comfy-table 7.2.2 crate/::{modifiersrust-analyzer cargo comfy-table 7.2.2 style/modifiers/::*, presetsrust-analyzer cargo comfy-table 7.2.2 style/presets/::*, *};
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 fn get_preset_tablerust-analyzer cargo comfy-table 7.2.2 all/modifiers_test/get_preset_table().() -> Tablerust-analyzer cargo comfy-table 7.2.2 table/Table# {
5 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().();
6 table
7 .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!!["Header1", "Header2", "Header3"])
8 .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!!["One One", "One Two", "One Three"])
9 .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!!["One One", "One Two", "One Three"]);
10
11 table
12 }
13
14 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
15 fn utf8_round_cornersrust-analyzer cargo comfy-table 7.2.2 all/modifiers_test/utf8_round_corners().() {
16 let mut table = get_preset_tablerust-analyzer cargo comfy-table 7.2.2 all/modifiers_test/get_preset_table().();
17 table
18 .load_presetrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]load_preset().(UTF8_FULLrust-analyzer cargo comfy-table 7.2.2 style/presets/UTF8_FULL.)
19 .apply_modifierrust-analyzer cargo comfy-table 7.2.2 table/impl#[Table]apply_modifier().(UTF8_ROUND_CORNERSrust-analyzer cargo comfy-table 7.2.2 style/modifiers/UTF8_ROUND_CORNERS.);
20 let expected = "
21 ╭─────────┬─────────┬───────────╮
22 │ Header1 ┆ Header2 ┆ Header3 │
23 ╞═════════╪═════════╪═══════════╡
24 │ One One ┆ One Two ┆ One Three │
25 ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
26 │ One One ┆ One Two ┆ One Three │
27 ╰─────────┴─────────┴───────────╯";
28
29 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{table}");
30 assert_eqrust-analyzer cargo pretty_assertions 1.4.1 assert_eq!!(expected, "\n".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().() +rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#add(). &table.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().());
31 }