linesweeper: the paperjs test fails when its data files cannot be loaded

tests/paperjs.rs reads its cases from boolean-test/data/, which the 0.5.0
package does not include. It skipped any file it could not load, so the
paperjs target ran 0 trials and passed. A file that cannot be loaded now
becomes a failing <operation>/load trial, and load_errors_are_reported
checks that a missing file produces one. README.craft.md, SOURCE.json and
NOTICE record the change as a local patch.
This commit is contained in:
dotCooCoo committed 2026-11-07 03:57:47 -08:00
1 parent f211604aad
commit 60b287c846
4 files changed
+44 -18

No files matched your search

+3 -3
View File
@@ -218,10 +218,10 @@ applications retain their own document-font selection and licensing policy.
linesweeper
linesweeper 0.5.0 (https://crates.io/crates/linesweeper/0.5.0), MIT OR Apache-2.0, is stored in
vendor/linesweeper with its upstream license files and no file changed. Its manifest names Joe Neeman
vendor/linesweeper with its upstream license files and one local patch. Its manifest names Joe Neeman
as author, and its LICENSE-MIT reads "Copyright (c) 2018 Raph Levien". See
vendor/linesweeper/README.craft.md and vendor/linesweeper/SOURCE.json for provenance and the files
left out.
vendor/linesweeper/README.craft.md and vendor/linesweeper/SOURCE.json for provenance, the local
change and the files left out.
Platform lifecycle source provenance
+13 -7
View File
@@ -1,15 +1,21 @@
# Local linesweeper 0.5.0 copy
This is the crates.io linesweeper 0.5.0 package (MIT OR Apache-2.0) with some files left out and no
file changed. `.cargo_vcs_info.json` names the commit it was packaged from,
This is the crates.io linesweeper 0.5.0 package (MIT OR Apache-2.0) with some files left out and the
local patches listed below. `.cargo_vcs_info.json` names the commit it was packaged from,
`824b0791a750f7b27b8edcbb6c6244d0e629875e`. That commit is not in the GitHub repository the manifest
names, which is archived; its README says development moved off GitHub.
Every file here except this one and `SOURCE.json` is byte for byte the file in the `.crate` archive.
`SOURCE.json` records the hash of the `.crate` download (`source_archive_sha256`) and, for every file
kept, the hash in the package (`source_sha256`) and the hash here (`sha256`). `upstream_repository` is
null because no public repository this copy can name holds `upstream_revision`. `local_patches` is
empty.
Every file here except this one, `SOURCE.json` and the patched files below is byte for byte the file
in the `.crate` archive. `SOURCE.json` records the hash of the `.crate` download
(`source_archive_sha256`) and, for every file kept, the hash in the package (`source_sha256`) and the
hash here (`sha256`). `upstream_repository` is null because no public repository this copy can name
holds `upstream_revision`. `local_patches` describes each local patch.
## Local patches
| File | Change |
|---|---|
| `tests/paperjs.rs` | A test file in `boolean-test/data/` that cannot be loaded becomes a failing `<operation>/load` trial. The package does not include `boolean-test/data/`, and the packaged file skipped files it could not load, so the `paperjs` target passed with zero trials. The `load_errors_are_reported` trial covers a missing file; run it with `cargo test --locked --test paperjs load_errors_are_reported`. The full `paperjs` target fails here because the data files are not included. |
`omitted_files` lists the 43 files of the package left out here, with their hashes:
+4 -2
View File
@@ -7,7 +7,9 @@
"upstream_repository": null,
"upstream_revision": "824b0791a750f7b27b8edcbb6c6244d0e629875e",
"upstream_directory": "",
"local_patches": [],
"local_patches": [
"In `tests/paperjs.rs`, a test file in `boolean-test/data/` that cannot be loaded becomes a failing `<operation>/load` trial instead of being skipped, so the `paperjs` target no longer passes with zero trials when the data files are missing."
],
"files": [
{ "path": ".cargo_vcs_info.json", "source_sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc", "source_git_blob": null, "sha256": "47fba6a9dbdf445a5c97f783c9be62093035f9d5e5cdc2cf3216ad8259bcd8fc" },
{ "path": ".gitignore", "source_sha256": "88b59092499ae05234330eb7d0b01e953e969caf05261530e3765eef02536cf0", "source_git_blob": null, "sha256": "88b59092499ae05234330eb7d0b01e953e969caf05261530e3765eef02536cf0" },
@@ -67,7 +69,7 @@
{ "path": "src/treevec.rs", "source_sha256": "d88b9fbf02fa9f318560e1d483d465555f2b696ae12c00f8e4f5b71ea6779445", "source_git_blob": null, "sha256": "d88b9fbf02fa9f318560e1d483d465555f2b696ae12c00f8e4f5b71ea6779445" },
{ "path": "src/typed_vec.rs", "source_sha256": "3e9a2675b8a40d8fc4df0575bd9d0d16b5604d18e9b78638dd5a612b28fc4c30", "source_git_blob": null, "sha256": "3e9a2675b8a40d8fc4df0575bd9d0d16b5604d18e9b78638dd5a612b28fc4c30" },
{ "path": "tests/fonts.rs", "source_sha256": "081604ebf560a19ff0427efd9a17eaaa0a3b46ad0bf58323fd6e21b6c0764400", "source_git_blob": null, "sha256": "081604ebf560a19ff0427efd9a17eaaa0a3b46ad0bf58323fd6e21b6c0764400" },
{ "path": "tests/paperjs.rs", "source_sha256": "6ff2a3178f13cde3d7304101ae592ae32b4b2734069f5fc56a532a4883d9f782", "source_git_blob": null, "sha256": "6ff2a3178f13cde3d7304101ae592ae32b4b2734069f5fc56a532a4883d9f782" },
{ "path": "tests/paperjs.rs", "source_sha256": "6ff2a3178f13cde3d7304101ae592ae32b4b2734069f5fc56a532a4883d9f782", "source_git_blob": null, "sha256": "912c846f6da58f7c89431e8f4d6e771e6ebdbcb36b9c32edf8714d721fbfe200" },
{ "path": "tests/regression.rs", "source_sha256": "b2341934aa001ba26c688a1ca3a7ee55d29105d67b6036bb05bb367b69976fce", "source_git_blob": null, "sha256": "b2341934aa001ba26c688a1ca3a7ee55d29105d67b6036bb05bb367b69976fce" },
{ "path": "tests/regression/awesome_0.txt", "source_sha256": "6f7dfbb7ca62463843c058617d557553fdc8d8b3add512bee8f813b37a256611", "source_git_blob": null, "sha256": "6f7dfbb7ca62463843c058617d557553fdc8d8b3add512bee8f813b37a256611" },
{ "path": "tests/regression/graphite_0.txt", "source_sha256": "f5d9e94ae6fab7d29f8a3aa0ccd9d96fc9b709c0ee3fbae8b000bec8c33628b9", "source_git_blob": null, "sha256": "f5d9e94ae6fab7d29f8a3aa0ccd9d96fc9b709c0ee3fbae8b000bec8c33628b9" },
+24 -6
View File
@@ -11,8 +11,6 @@ fn main() {
}
fn paperjs_tests() -> Vec<Trial> {
let mut tests = Vec::new();
// Load all test files
let test_files = vec![
("boolean-test/data/intersection.json", "intersection"),
@@ -20,12 +18,32 @@ fn paperjs_tests() -> Vec<Trial> {
("boolean-test/data/subtraction.json", "subtraction"),
];
for (file_path, op_name) in test_files {
if let Ok(file_tests) = load_test_file(file_path, op_name) {
tests.extend(file_tests);
let mut tests = trials_for(&test_files);
tests.push(Trial::test("load_errors_are_reported", || {
let trials = trials_for(&[("boolean-test/data/missing.json", "missing")]);
let names: Vec<&str> = trials.iter().map(Trial::name).collect();
if names == ["missing/load"] {
Ok(())
} else {
Err(format!("expected one failing load trial, got {names:?}").into())
}
}));
tests
}
fn trials_for(test_files: &[(&str, &str)]) -> Vec<Trial> {
let mut tests = Vec::new();
for &(file_path, op_name) in test_files {
match load_test_file(file_path, op_name) {
Ok(file_tests) => tests.extend(file_tests),
Err(e) => {
let message = format!("cannot load {file_path}: {e}");
tests.push(Trial::test(format!("{op_name}/load"), move || {
Err(message.into())
}));
}
}
}
tests
}