style: format the whole tree with cargo fmt (stock defaults, #35)
One-time, mechanical reformat — no functional changes. The tree was not rustfmt-clean (~1800 hunks across ~100 files); this brings it to stock `cargo fmt` defaults so a `cargo fmt --check` CI gate can follow. Behaviour-preserving: 2509 pass / 0 fail / 1 ignored (unchanged baseline), clippy clean. A .git-blame-ignore-revs entry follows so `git blame` skips this commit.
This commit is contained in:
@@ -49,7 +49,11 @@ fn submit(app: &mut App) -> Vec<Action> {
|
||||
/// and don't care about the verbatim user input.
|
||||
#[track_caller]
|
||||
fn assert_one_execute_dsl(actions: &[Action], expected: &Command) {
|
||||
assert_eq!(actions.len(), 1, "expected exactly one action; got {actions:?}");
|
||||
assert_eq!(
|
||||
actions.len(),
|
||||
1,
|
||||
"expected exactly one action; got {actions:?}"
|
||||
);
|
||||
match &actions[0] {
|
||||
Action::ExecuteDsl { command, .. } => assert_eq!(command, expected),
|
||||
other => panic!("expected ExecuteDsl, got {other:?}"),
|
||||
@@ -234,9 +238,18 @@ fn status_bar_is_keystroke_only_and_state_aware() {
|
||||
|
||||
// Default (empty input): nav / complete / history / run keystrokes.
|
||||
let default_view = rendered_text(&mut app, &theme, 80, 24);
|
||||
assert!(default_view.contains("Ctrl-O sidebar"), "strip lists sidebar:\n{default_view}");
|
||||
assert!(default_view.contains("Enter run"), "strip lists run:\n{default_view}");
|
||||
assert!(!default_view.contains("Ctrl-C"), "quit dropped from the strip:\n{default_view}");
|
||||
assert!(
|
||||
default_view.contains("Ctrl-O sidebar"),
|
||||
"strip lists sidebar:\n{default_view}"
|
||||
);
|
||||
assert!(
|
||||
default_view.contains("Enter run"),
|
||||
"strip lists run:\n{default_view}"
|
||||
);
|
||||
assert!(
|
||||
!default_view.contains("Ctrl-C"),
|
||||
"quit dropped from the strip:\n{default_view}"
|
||||
);
|
||||
assert!(
|
||||
!default_view.contains("advanced once"),
|
||||
"`:` command word dropped from the strip:\n{default_view}",
|
||||
@@ -245,8 +258,14 @@ fn status_bar_is_keystroke_only_and_state_aware() {
|
||||
// Editing (input has text): the #29 readline edit keys appear.
|
||||
type_str(&mut app, "create");
|
||||
let editing = rendered_text(&mut app, &theme, 80, 24);
|
||||
assert!(editing.contains("Esc clear"), "editing strip lists clear:\n{editing}");
|
||||
assert!(editing.contains("Ctrl-W del word"), "editing strip lists del word:\n{editing}");
|
||||
assert!(
|
||||
editing.contains("Esc clear"),
|
||||
"editing strip lists clear:\n{editing}"
|
||||
);
|
||||
assert!(
|
||||
editing.contains("Ctrl-W del word"),
|
||||
"editing strip lists del word:\n{editing}"
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
@@ -326,7 +345,9 @@ fn create_table_flow_updates_tables_list_and_structure_view() {
|
||||
// `id` row shows both the name and its `serial` type
|
||||
// separated by box-drawing characters.
|
||||
assert!(
|
||||
rendered.lines().any(|l| l.contains("id") && l.contains("serial")),
|
||||
rendered
|
||||
.lines()
|
||||
.any(|l| l.contains("id") && l.contains("serial")),
|
||||
"output should show the id/serial column row:\n{rendered}"
|
||||
);
|
||||
}
|
||||
@@ -336,10 +357,7 @@ fn add_column_flow_updates_structure_view() {
|
||||
let mut app = App::new();
|
||||
// Simulate the prior create_table state.
|
||||
app.tables = vec!["Customers".to_string()];
|
||||
app.current_table = Some(fake_table(
|
||||
"Customers",
|
||||
&[("id", Type::Serial, true)],
|
||||
));
|
||||
app.current_table = Some(fake_table("Customers", &[("id", Type::Serial, true)]));
|
||||
|
||||
type_str(&mut app, "add column to table Customers: Name (text)");
|
||||
let actions = submit(&mut app);
|
||||
@@ -376,7 +394,9 @@ fn add_column_flow_updates_structure_view() {
|
||||
assert_eq!(app.current_table, Some(updated));
|
||||
let rendered = rendered_text(&mut app, &Theme::dark(), 80, 24);
|
||||
assert!(
|
||||
rendered.lines().any(|l| l.contains("Name") && l.contains("text")),
|
||||
rendered
|
||||
.lines()
|
||||
.any(|l| l.contains("Name") && l.contains("text")),
|
||||
"expected the Name/text column row:\n{rendered}",
|
||||
);
|
||||
}
|
||||
@@ -496,10 +516,7 @@ fn add_relationship_flow_shows_parent_side_with_inbound_section() {
|
||||
assert!(rendered.contains("on delete cascade"), "{rendered}");
|
||||
// The [ok] subject lists the endpoints. Long lines wrap in
|
||||
// the panel, so we check the first half of the phrase only.
|
||||
assert!(
|
||||
rendered.contains("from Customers.Id"),
|
||||
"{rendered}"
|
||||
);
|
||||
assert!(rendered.contains("from Customers.Id"), "{rendered}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -551,11 +568,23 @@ fn add_column_confirmation_omits_relationship_prose() {
|
||||
let rendered = rendered_text(&mut app, &Theme::dark(), 80, 24);
|
||||
// The structure box still renders (table name + the column box from
|
||||
// the returned description).
|
||||
assert!(rendered.contains("Customers"), "structure header:\n{rendered}");
|
||||
assert!(rendered.contains("Constraints"), "structure box:\n{rendered}");
|
||||
assert!(
|
||||
rendered.contains("Customers"),
|
||||
"structure header:\n{rendered}"
|
||||
);
|
||||
assert!(
|
||||
rendered.contains("Constraints"),
|
||||
"structure box:\n{rendered}"
|
||||
);
|
||||
// The relationship block is gone — neither prose heading nor line.
|
||||
assert!(!rendered.contains("Referenced by:"), "no prose heading:\n{rendered}");
|
||||
assert!(!rendered.contains("References:"), "no prose heading:\n{rendered}");
|
||||
assert!(
|
||||
!rendered.contains("Referenced by:"),
|
||||
"no prose heading:\n{rendered}"
|
||||
);
|
||||
assert!(
|
||||
!rendered.contains("References:"),
|
||||
"no prose heading:\n{rendered}"
|
||||
);
|
||||
assert!(
|
||||
!rendered.contains("Orders.CustId → Id"),
|
||||
"no prose line:\n{rendered}",
|
||||
@@ -682,8 +711,14 @@ fn validity_indicator_renders_err_and_wrn_labels() {
|
||||
let mut app = App::new();
|
||||
|
||||
let clean = rendered_text(&mut app, &Theme::dark(), 80, 24);
|
||||
assert!(!clean.contains("[ERR]"), "clean input shows no label:\n{clean}");
|
||||
assert!(!clean.contains("[WRN]"), "clean input shows no label:\n{clean}");
|
||||
assert!(
|
||||
!clean.contains("[ERR]"),
|
||||
"clean input shows no label:\n{clean}"
|
||||
);
|
||||
assert!(
|
||||
!clean.contains("[WRN]"),
|
||||
"clean input shows no label:\n{clean}"
|
||||
);
|
||||
|
||||
app.input_indicator = Some(Severity::Error);
|
||||
let err = rendered_text(&mut app, &Theme::dark(), 80, 24);
|
||||
|
||||
Reference in New Issue
Block a user