summaryrefslogtreecommitdiffstats
path: root/tests/surfaces.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-22 10:36:24 +0000
committeraur-build <aur-build@localhost>2026-11-22 10:36:24 +0000
commit3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (patch)
tree7cc7169181b4bdd73fd8817f8c1d7cce6e6998a8 /tests/surfaces.rs
parent9dc9087d89891c6e5ef7e5dc084dd13c8611843e (diff)
downloadaur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.tar.gz
aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.zip
rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off
rustfmt.toml fixes the shape the tree is written in (120 columns, small items kept on one line) and one canonical pass makes it the truth. [lints.clippy] names the idiom lints worth enforcing and leaves out the two that would add doc-comment boilerplate rather than remove it. The tree pays them off here: write!/writeln! instead of push_str(&format!()), let-else instead of match-on-Option, borrows where a thread entry point only reads what it owns, no `&self` on a Copy state and no `self` nobody reads. ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and value are now emitted by the same call instead of three.
Diffstat (limited to 'tests/surfaces.rs')
-rw-r--r--tests/surfaces.rs30
1 files changed, 13 insertions, 17 deletions
diff --git a/tests/surfaces.rs b/tests/surfaces.rs
index 87b860d..15e07c3 100644
--- a/tests/surfaces.rs
+++ b/tests/surfaces.rs
@@ -27,10 +27,7 @@ fn attention_lists_outdated_dependencies_from_the_recorded_world() {
let web = Web::attach(env, client);
web.publish("plain-make");
web.publish("dep-client");
- assert!(
- !web.get("/attention").body.contains("Outdated:"),
- "dep-client is fresh right after both were published"
- );
+ assert!(!web.get("/attention").body.contains("Outdated:"), "dep-client is fresh right after both were published");
plain.bump(&[("pkgver", "2.0")]);
web.publish("plain-make");
@@ -60,7 +57,10 @@ fn the_package_page_answers_dependencies_and_staleness() {
let other = web.get("/packages/plain-make");
assert!(other.body.contains("Needed by"), "no needed-by block");
assert!(other.body.contains("dep-client"), "the dependent is not listed");
- assert!(other.body.contains("aur.archlinux.org/cgit/aur.git/tree/?h=plain-make&amp;id="), "no per-release cgit link");
+ assert!(
+ other.body.contains("aur.archlinux.org/cgit/aur.git/tree/?h=plain-make&amp;id="),
+ "no per-release cgit link"
+ );
assert!(other.body.contains("serving 2.0"), "the summary does not say what is served");
}
@@ -80,10 +80,7 @@ fn a_manual_rebuild_reuses_the_approved_identity_without_a_new_approval() {
"a manual rebuild must not mint an approval"
);
- let queued = web
- .env
- .query_i64("SELECT count(*) FROM build WHERE kind='manual_rebuild'", &[])
- .unwrap();
+ let queued = web.env.query_i64("SELECT count(*) FROM build WHERE kind='manual_rebuild'", &[]).unwrap();
assert_eq!(queued, 1, "the rebuild was not queued");
let id: String = web
@@ -91,13 +88,9 @@ fn a_manual_rebuild_reuses_the_approved_identity_without_a_new_approval() {
.db
.read(|c| {
use rusqlite::OptionalExtension;
- c.query_row(
- "SELECT id FROM build WHERE kind='manual_rebuild'",
- [],
- |r| r.get::<_, String>(0),
- )
- .optional()
- .map_err(Into::into)
+ c.query_row("SELECT id FROM build WHERE kind='manual_rebuild'", [], |r| r.get::<_, String>(0))
+ .optional()
+ .map_err(Into::into)
})
.unwrap()
.unwrap();
@@ -150,7 +143,10 @@ fn pausing_a_subscription_stops_detection_and_resuming_starts_it_again() {
);
web.fx.bump(&[("pkgver", "3.0")]);
let report = aur_build::watch::detect::check_pkgbase(&web.env.cfg, &web.env.db, "plain-make").unwrap();
- assert!(matches!(report.outcome, aur_build::watch::detect::Outcome::Paused), "a paused subscription was still inspected");
+ assert!(
+ matches!(report.outcome, aur_build::watch::detect::Outcome::Paused),
+ "a paused subscription was still inspected"
+ );
assert_eq!(
candidates::pending_candidates(&web.env.db).unwrap().len(),
0,