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:
@@ -22,14 +22,16 @@ fn tempdir() -> tempfile::TempDir {
|
||||
#[test]
|
||||
fn no_args_creates_temp_project_under_data_root() {
|
||||
let data = tempdir();
|
||||
let project = project::open_or_create(None, Some(data.path()))
|
||||
.expect("open_or_create with empty CLI");
|
||||
let project =
|
||||
project::open_or_create(None, Some(data.path())).expect("open_or_create with empty CLI");
|
||||
|
||||
let path = project.path();
|
||||
assert!(path.exists(), "project dir should exist");
|
||||
assert!(path.starts_with(data.path()));
|
||||
assert_eq!(
|
||||
path.parent().and_then(|p| p.file_name()).map(|s| s.to_string_lossy().into_owned()),
|
||||
path.parent()
|
||||
.and_then(|p| p.file_name())
|
||||
.map(|s| s.to_string_lossy().into_owned()),
|
||||
Some(PROJECTS_SUBDIR.to_string()),
|
||||
);
|
||||
|
||||
@@ -96,8 +98,7 @@ fn positional_path_opens_existing_project() {
|
||||
|
||||
// Now drive open_or_create with the path as if it were a
|
||||
// CLI positional argument.
|
||||
let project = project::open_or_create(Some(&path), None)
|
||||
.expect("open via positional path");
|
||||
let project = project::open_or_create(Some(&path), None).expect("open via positional path");
|
||||
assert_eq!(project.path(), path);
|
||||
}
|
||||
|
||||
@@ -142,7 +143,10 @@ fn data_dir_override_does_not_touch_default_os_dir() {
|
||||
|
||||
assert!(p1_path.starts_with(data.path()));
|
||||
assert!(p2_path.starts_with(data.path()));
|
||||
assert_ne!(p1_path, p2_path, "two temp projects must have distinct names");
|
||||
assert_ne!(
|
||||
p1_path, p2_path,
|
||||
"two temp projects must have distinct names"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -167,11 +171,18 @@ fn db_persists_across_open_close_cycles() {
|
||||
db.create_table(
|
||||
"Customers".to_string(),
|
||||
vec![
|
||||
rdbms_playground::dsl::ColumnSpec::new("id".to_string(), rdbms_playground::dsl::Type::Serial),
|
||||
rdbms_playground::dsl::ColumnSpec::new("Name".to_string(), rdbms_playground::dsl::Type::Text),
|
||||
rdbms_playground::dsl::ColumnSpec::new(
|
||||
"id".to_string(),
|
||||
rdbms_playground::dsl::Type::Serial,
|
||||
),
|
||||
rdbms_playground::dsl::ColumnSpec::new(
|
||||
"Name".to_string(),
|
||||
rdbms_playground::dsl::Type::Text,
|
||||
),
|
||||
],
|
||||
vec!["id".to_string()],
|
||||
None)
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.expect("create_table");
|
||||
});
|
||||
@@ -187,7 +198,9 @@ fn db_persists_across_open_close_cycles() {
|
||||
.enable_all()
|
||||
.build()
|
||||
.unwrap();
|
||||
let tables = rt.block_on(async { db.list_tables().await }).expect("list_tables");
|
||||
let tables = rt
|
||||
.block_on(async { db.list_tables().await })
|
||||
.expect("list_tables");
|
||||
assert!(tables.iter().any(|t| t == "Customers"), "got: {tables:?}");
|
||||
|
||||
// Sanity: the project.yaml and history.log are still empty
|
||||
|
||||
Reference in New Issue
Block a user