diff options
| author | aur-build <aur-build@localhost> | 2026-11-19 17:09:59 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-19 17:09:59 +0000 |
| commit | e757979f1a2afdbe7146066345bb9acd19d3b151 (patch) | |
| tree | 30d5f5fbccd25ea7bf01c5202684af463b74e7d3 /tests/world.rs | |
| parent | 94c318f13264bb3c00a9f3057ba2e1aafb57c9e4 (diff) | |
| download | aur-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/world.rs')
| -rw-r--r-- | tests/world.rs | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/tests/world.rs b/tests/world.rs index 8229d62..3a7dd54 100644 --- a/tests/world.rs +++ b/tests/world.rs @@ -1,14 +1,3 @@ -//! `.PKGINFO` / `.BUILDINFO` parsing and the world snapshot (§10.1, I12). -//! -//! The world snapshot is the whole basis of staleness: "would rebuilding this -//! change what a consumer gets?" only means something if we recorded, at build -//! time, the exact set of our packages the build saw. Two properties matter and -//! are tested here — that the record comes from the archive rather than from -//! anything the build asserted about itself, and that it is intersected with our -//! own index **at ingest time**, because an unfiltered `.BUILDINFO` would make -//! every package permanently stale (Arch never stops moving) and the Attention -//! page would be noise forever. - mod common; use aur_build::db; @@ -17,8 +6,7 @@ use aur_build::pkginfo; use common::*; /// Build a real `.pkg.tar.zst`: zstd-compressed tar with the two metadata files -/// inside, exactly as makepkg lays them out. `None` for either means the file is -/// absent from the archive. +/// inside, as makepkg lays them out. `None` means the file is absent. fn make_archive(dir: &std::path::Path, name: &str, pkginfo: Option<&str>, buildinfo: Option<&str>) -> std::path::PathBuf { let path = dir.join(format!("{name}.pkg.tar.zst")); let enc = std::io::BufWriter::new(std::fs::File::create(&path).unwrap()); @@ -132,15 +120,13 @@ fn the_world_snapshot_is_intersected_with_our_index_at_ingest_time() { // §10.1 / I12. The fixture's build root contains glibc, pacman, binutils and // plain-make; only plain-make is ours, and only plain-make may be recorded. let (env, fx) = env_with_fixture("plain-make"); - // The first build has no world of ours to record — nothing we publish exists - // yet. That is the honest answer, not an empty lie about glibc. + // The first build has no world of ours to record — the honest answer, not an + // empty lie about glibc. publish(&env, "plain-make"); let first = world_of_last_build(&env); assert!(first.is_empty(), "nothing of ours existed for the first build: {first:?}"); - // Now plain-make is in the index, so a later build records it and nothing - // else. A real chroot with our repo enabled has the previous version of the - // package installed; the manifest says the same. + // Now plain-make is in the index, so a later build records it and nothing else. let mut manifest = fx.manifest_json(); manifest["installed"] = serde_json::json!([ { "name": "glibc", "version": "2.39-1", "arch": "x86_64" }, @@ -169,8 +155,7 @@ fn the_world_snapshot_is_intersected_with_our_index_at_ingest_time() { #[test] fn a_split_pkgbase_is_one_approval_and_many_index_rows() { - // §3: one recipe, several packages, one human decision. Every package the - // build produced gets its own index entry and its own artifact. + // §3: one recipe, several packages, one human decision. let (env, _fx) = env_with_fixture("split-pkgbase"); publish(&env, "split-pkgbase"); let rows: Vec<String> = env |
