From 4304b0f336ddba7b4ec6780795059ff2066d105b Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:33:17 +0000 Subject: comments: keep only what the code cannot show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound. --- tests/world.rs | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'tests/world.rs') diff --git a/tests/world.rs b/tests/world.rs index 3a7dd54..7de4f85 100644 --- a/tests/world.rs +++ b/tests/world.rs @@ -5,8 +5,6 @@ use aur_build::pipeline; use aur_build::pkginfo; use common::*; -/// Build a real `.pkg.tar.zst`: zstd-compressed tar with the two metadata files -/// 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()); @@ -75,7 +73,6 @@ fn pkginfo_fields_are_parsed_from_the_archive_itself() { assert_eq!(meta.version, "1.0-1"); assert_eq!(meta.arch, "x86_64"); assert_eq!(meta.desc, "a synthetic package"); - // Repeated keys are lists, not last-one-wins. assert_eq!(meta.license, vec!["MIT", "Apache"]); assert_eq!(meta.depends, vec!["glibc", "openssl>=1.1"]); assert_eq!(meta.makedepends, vec!["cmake"]); @@ -99,34 +96,25 @@ fn the_buildinfo_installed_block_is_parsed_line_by_line() { ], "the installed block must come through exactly" ); - // The block ends at the first unindented line; `sigfile` is not an install. assert!(!installed.iter().any(|i| i.name == "sigfile")); } #[test] fn a_package_without_a_pkginfo_is_refused_not_defaulted() { - // Ingest decides what the index claims about a package. Guessing a name from - // the filename would let a mislabeled artifact into a signed repo. let dir = tempfile::tempdir().unwrap(); let path = make_archive(dir.path(), "mystery", None, Some(BUILDINFO)); let bytes = std::fs::read(&path).unwrap(); assert!(pkginfo::pkginfo_text(&bytes).is_err(), "an archive with no .PKGINFO must not parse"); - // And a truncated archive is an error too, not an empty success. assert!(pkginfo::pkginfo_text(b"not even a zstd stream").is_err()); } #[test] 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 — 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. let mut manifest = fx.manifest_json(); manifest["installed"] = serde_json::json!([ { "name": "glibc", "version": "2.39-1", "arch": "x86_64" }, @@ -145,7 +133,6 @@ fn the_world_snapshot_is_intersected_with_our_index_at_ingest_time() { "{foreign} is not ours and must not be in the snapshot — an unfiltered world makes every package permanently stale" ); } - // And the snapshot is attached to the build, not computed later. assert_eq!( env.query_i64("SELECT count(*) FROM build WHERE state='succeeded' AND world_snapshot_id IS NULL", &[]), Some(0), @@ -155,7 +142,6 @@ 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. let (env, _fx) = env_with_fixture("split-pkgbase"); publish(&env, "split-pkgbase"); let rows: Vec = env @@ -178,7 +164,6 @@ fn a_split_pkgbase_is_one_approval_and_many_index_rows() { rows.iter().all(|r| r.contains("art=Some")), "every index row needs its own artifact: {rows:?}" ); - // One approval, however many packages came out of it. assert_eq!(env.query_i64("SELECT count(*) FROM approval", &[]), Some(1)); assert_eq!(env.query_i64("SELECT count(*) FROM release", &[]), Some(1)); } -- cgit v1.2.3