improve: show whole-diff totals alongside file stats

This commit is contained in:
Valdemar Lorenzen
2026-10-20 12:29:06 +02:00
parent a5a246db77
commit 759947736e
15 changed files with 394 additions and 48 deletions
+8 -3
View File
@@ -77,6 +77,9 @@ fn omitted_options_inherit_and_explicit_groups_replace_defaults() {
#[test]
fn both_positions_accept_all_builtins_and_custom_styles() {
let defaults = ChromeLine::top();
assert_eq!(defaults.right, ["diff", "shell", "battery"]);
assert_eq!(defaults.segment("diff"), defaults.segment("shell"));
let names = [
"tabs",
"mode",
@@ -90,6 +93,7 @@ fn both_positions_accept_all_builtins_and_custom_styles() {
"lsp",
"position",
"battery",
"diff",
"workspace",
];
let options = serde_json::json!({
@@ -119,7 +123,7 @@ fn both_positions_accept_all_builtins_and_custom_styles() {
}
#[test]
fn view_placeholder_is_valid_in_every_segment_and_bar() {
fn comparison_placeholders_are_valid_in_every_segment_and_bar() {
for name in [
"tabs",
"mode",
@@ -133,11 +137,12 @@ fn view_placeholder_is_valid_in_every_segment_and_bar() {
"lsp",
"position",
"battery",
"diff",
"workspace",
] {
let options = serde_json::json!({
"left": [name],
(name): {"title": "{index}:{view}{name}:{path}{modified}"}
(name): {"title": "{index}:{view}{name}{changes}:{path}{modified}"}
});
let lines: Lines = serde_json::from_value(serde_json::json!({
"top": options,
@@ -147,7 +152,7 @@ fn view_placeholder_is_valid_in_every_segment_and_bar() {
for line in [&lines.top, &lines.bottom] {
assert_eq!(
line.segment(name).title,
"{index}:{view}{name}:{path}{modified}"
"{index}:{view}{name}{changes}:{path}{modified}"
);
}
}