Skip to content

Commit 5721791

Browse files
committed
style(node): apply cargo fmt to dedup test code
1 parent 8e8b74b commit 5721791

3 files changed

Lines changed: 42 additions & 9 deletions

File tree

‎crates/gitlawb-node/src/api/repos.rs‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,12 +1709,21 @@ mod tests {
17091709
fn full_tie_resolves_by_id_asc() {
17101710
// Two canonical rows in one group, identical created_at; only id differs.
17111711
// Survivor is id ASC, matching SQL's DISTINCT ON (… created_at ASC, id ASC).
1712-
let bbb = record("bbb", "did:key:z6Same", "repo", "real", "2026-01-01T00:00:00Z");
1712+
let bbb = record(
1713+
"bbb",
1714+
"did:key:z6Same",
1715+
"repo",
1716+
"real",
1717+
"2026-01-01T00:00:00Z",
1718+
);
17131719
let aaa = record("aaa", "z6Same", "repo", "real", "2026-01-01T00:00:00Z");
17141720

17151721
let out = dedupe_canonical_repos(vec![(bbb, 0), (aaa, 0)]);
17161722

17171723
assert_eq!(out.len(), 1, "same group collapses");
1718-
assert_eq!(out[0].0.id, "aaa", "id ASC breaks a full tie deterministically");
1724+
assert_eq!(
1725+
out[0].0.id, "aaa",
1726+
"id ASC breaks a full tie deterministically"
1727+
);
17191728
}
17201729
}

‎crates/gitlawb-node/src/db/mod.rs‎

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,14 @@ mod dedup_db_tests {
30763076

30773077
/// Build a repo row with explicit timestamps. A slash in `id` marks a mirror
30783078
/// row (the format `upsert_mirror_repo` writes); a UUID-shaped `id` is canonical.
3079-
fn rec(id: &str, owner_did: &str, name: &str, desc: &str, created: &str, updated: &str) -> RepoRecord {
3079+
fn rec(
3080+
id: &str,
3081+
owner_did: &str,
3082+
name: &str,
3083+
desc: &str,
3084+
created: &str,
3085+
updated: &str,
3086+
) -> RepoRecord {
30803087
RepoRecord {
30813088
id: id.to_string(),
30823089
name: name.to_string(),
@@ -3147,7 +3154,11 @@ mod dedup_db_tests {
31473154
.unwrap();
31483155

31493156
let out = db.list_all_repos_deduped().await.unwrap();
3150-
assert_eq!(out.len(), 1, "real mirror row collapses with its canonical twin");
3157+
assert_eq!(
3158+
out.len(),
3159+
1,
3160+
"real mirror row collapses with its canonical twin"
3161+
);
31513162
assert_eq!(out[0].owner_did, "did:key:z6Mkwbud", "canonical row wins");
31523163
}
31533164

@@ -3245,7 +3256,10 @@ mod dedup_db_tests {
32453256

32463257
let out = db.list_all_repos_deduped().await.unwrap();
32473258
assert_eq!(out.len(), 1, "same group collapses");
3248-
assert_eq!(out[0].id, "aaa", "id ASC breaks a full tie deterministically");
3259+
assert_eq!(
3260+
out[0].id, "aaa",
3261+
"id ASC breaks a full tie deterministically"
3262+
);
32493263
}
32503264

32513265
/// Marker robustness: a canonical row whose `description` is literally
@@ -3264,7 +3278,7 @@ mod dedup_db_tests {
32643278
"2026-01-15T00:00:00Z",
32653279
);
32663280
let mirror = rec(
3267-
"z6Mkwbud/nipmod", // slash id = the real structural marker
3281+
"z6Mkwbud/nipmod", // slash id = the real structural marker
32683282
"z6Mkwbud",
32693283
"nipmod",
32703284
"a normal description, not the marker",
@@ -3292,7 +3306,11 @@ mod dedup_db_tests {
32923306
.unwrap();
32933307

32943308
let out = db.list_all_repos_deduped().await.unwrap();
3295-
assert_eq!(out.len(), 1, "a mirror-only group still yields one logical repo");
3309+
assert_eq!(
3310+
out.len(),
3311+
1,
3312+
"a mirror-only group still yields one logical repo"
3313+
);
32963314
assert_eq!(out[0].id, "z6Lonely/orphan");
32973315
assert_eq!(db.count_repos_deduped().await.unwrap(), 1);
32983316
}

‎crates/gitlawb-node/src/test_support.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,10 @@ mod tests {
532532
.expect("seed mirror");
533533
state
534534
.db
535-
.create_repo(&seed_repo("did:key:zGQLOTHERBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", "solo"))
535+
.create_repo(&seed_repo(
536+
"did:key:zGQLOTHERBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
537+
"solo",
538+
))
536539
.await
537540
.expect("seed standalone");
538541

@@ -576,7 +579,10 @@ mod tests {
576579
.expect("seed mirror");
577580
state
578581
.db
579-
.create_repo(&seed_repo("did:key:zSTATSOTHERBBBBBBBBBBBBBBBBBBBBBBBBBB", "solo"))
582+
.create_repo(&seed_repo(
583+
"did:key:zSTATSOTHERBBBBBBBBBBBBBBBBBBBBBBBBBB",
584+
"solo",
585+
))
580586
.await
581587
.expect("seed standalone");
582588

0 commit comments

Comments
 (0)