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:
@@ -24,8 +24,7 @@ fn rt() -> tokio::runtime::Runtime {
|
||||
|
||||
fn open() -> (project::Project, Database, tempfile::TempDir) {
|
||||
let dir = tempfile::tempdir().expect("create tempdir");
|
||||
let project =
|
||||
project::open_or_create(None, Some(dir.path())).expect("open or create project");
|
||||
let project = project::open_or_create(None, Some(dir.path())).expect("open or create project");
|
||||
let persistence = Persistence::new(project.path().to_path_buf());
|
||||
let db = Database::open_with_persistence_and_undo(project.db_path(), persistence, true)
|
||||
.expect("open db with persistence");
|
||||
@@ -48,7 +47,9 @@ fn make_t_with_check(db: &Database, r: &tokio::runtime::Runtime) {
|
||||
vec!["a < b".to_string()],
|
||||
vec![],
|
||||
false,
|
||||
Some("create table T (id int primary key, a int, b int, c text, check (a < b))".to_string()),
|
||||
Some(
|
||||
"create table T (id int primary key, a int, b int, c text, check (a < b))".to_string(),
|
||||
),
|
||||
))
|
||||
.expect("create T with table CHECK");
|
||||
}
|
||||
@@ -285,7 +286,10 @@ fn drop_column_covered_by_a_composite_unique_is_refused_with_the_derived_name()
|
||||
.block_on(db.drop_column("T".to_string(), "a".to_string(), false, None))
|
||||
.expect_err("dropping a composite-UNIQUE column is refused");
|
||||
let msg = err.friendly_message();
|
||||
assert!(msg.contains("unique_a_b"), "names the derived constraint; got: {msg}");
|
||||
assert!(
|
||||
msg.contains("unique_a_b"),
|
||||
"names the derived constraint; got: {msg}"
|
||||
);
|
||||
assert!(
|
||||
msg.contains("drop constraint unique_a_b"),
|
||||
"points at the actionable drop command; got: {msg}"
|
||||
@@ -351,14 +355,24 @@ fn rename_column_with_a_column_level_check_is_refused() {
|
||||
make_t_with_column_checks(&db, &r);
|
||||
// `qty`'s own check `qty >= 0` references qty → refused.
|
||||
assert!(
|
||||
r.block_on(db.rename_column("T".to_string(), "qty".to_string(), "amount".to_string(), None))
|
||||
.is_err(),
|
||||
r.block_on(db.rename_column(
|
||||
"T".to_string(),
|
||||
"qty".to_string(),
|
||||
"amount".to_string(),
|
||||
None
|
||||
))
|
||||
.is_err(),
|
||||
"renaming a column with its own column-level CHECK is refused"
|
||||
);
|
||||
// `price` is referenced by `discount`'s check `discount < price`.
|
||||
assert!(
|
||||
r.block_on(db.rename_column("T".to_string(), "price".to_string(), "cost".to_string(), None))
|
||||
.is_err(),
|
||||
r.block_on(db.rename_column(
|
||||
"T".to_string(),
|
||||
"price".to_string(),
|
||||
"cost".to_string(),
|
||||
None
|
||||
))
|
||||
.is_err(),
|
||||
"renaming a column referenced by another column's CHECK is refused"
|
||||
);
|
||||
// `id` is referenced by no CHECK → rename succeeds.
|
||||
|
||||
Reference in New Issue
Block a user