MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_table_render_with_alignment

Function test_table_render_with_alignment

atomic-cli/src/output/table.rs:762–774  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

760
761 #[test]
762 fn test_table_render_with_alignment() {
763 let mut table = Table::new();
764 table.set_columns(vec![
765 Column::new("Name").align(Alignment::Left),
766 Column::new("Count").align(Alignment::Right),
767 ]);
768 table.add_row(vec!["foo", "1"]);
769 table.add_row(vec!["barbaz", "100"]);
770
771 let output = table.to_string();
772 let lines: Vec<&str> = output.lines().collect();
773 assert!(lines.len() >= 3); // header + separator + 2 rows
774 }
775
776 #[test]
777 fn test_table_no_header_separator() {

Callers

nothing calls this directly

Calls 3

set_columnsMethod · 0.80
add_rowMethod · 0.80
linesMethod · 0.45

Tested by

no test coverage detected