summaryrefslogtreecommitdiffstats
path: root/tests/detect.rs
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-19 17:09:59 +0000
committeraur-build <aur-build@localhost>2026-11-19 17:09:59 +0000
commite757979f1a2afdbe7146066345bb9acd19d3b151 (patch)
tree30d5f5fbccd25ea7bf01c5202684af463b74e7d3 /tests/detect.rs
parent94c318f13264bb3c00a9f3057ba2e1aafb57c9e4 (diff)
downloadaur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.tar.gz
aur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.zip
comments: say why, not what
Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath.
Diffstat (limited to 'tests/detect.rs')
-rw-r--r--tests/detect.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/detect.rs b/tests/detect.rs
index e674c8a..6284b31 100644
--- a/tests/detect.rs
+++ b/tests/detect.rs
@@ -1,8 +1,3 @@
-//! Detection tests (§5.1, §5.1a, §5.3, §7.1) against a local `file://` "AUR".
-//!
-//! The fixtures are real git repos so the mirror, the pin and `recipe_hash` are
-//! exercised for real; only the network is replaced.
-
mod common;
use common::{git_add_commit, make_git_repo, params, Env, P};
@@ -74,8 +69,8 @@ fn git_head(p: &std::path::Path) -> String {
aur_build::git::head(p).unwrap()
}
-/// §3: `recipe_hash` covers the *entire* tree, because a shipped patch is part
-/// of the recipe and is a classic silent-change vector.
+/// §3: `recipe_hash` covers the *entire* tree, because a shipped patch is part of
+/// the recipe and is a classic silent-change vector.
#[test]
fn recipe_hash_covers_shipped_patches() {
let env = Env::new();
@@ -176,8 +171,8 @@ fn i2_diff_base_is_the_last_accepted_version_however_many_detections_arrive() {
assert_eq!(c2.base_release_id, Some(rel1), "base is the accepted release");
assert_eq!(c2.version(), "2.0-1");
- // v3 and v4 arrive while nobody is looking: they collapse into the same
- // review, and the base is *still* v1. The human sees v1 -> v4.
+ // v3 and v4 arrive while nobody is looking: they collapse into the same review,
+ // and the base is *still* v1.
for v in ["3.0", "4.0"] {
git_add_commit(&aur(&env, "foo"), &[("PKGBUILD", &common::pkgbuild("foo", v, "1", ""))], v);
check_pkgbase(&env.cfg, &env.db, "foo").unwrap();