From af95ab5e104557922126b82a287cbd47d3f564f8 Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:03:55 +0200 Subject: [PATCH] make sure roots are not deleted --- tests/full_tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/full_tests.rs b/tests/full_tests.rs index b6e6025..070c5bb 100644 --- a/tests/full_tests.rs +++ b/tests/full_tests.rs @@ -1,6 +1,8 @@ use anyhow::{ensure, Context, Result}; use once_cell::sync::Lazy; use regex::Regex; +use std::collections::hash_map::RandomState; +use std::collections::HashSet; use std::fs::Permissions; use std::io::BufWriter; use std::os::unix::prelude::PermissionsExt; @@ -153,6 +155,16 @@ fn build(path: &Path) -> Result<()> { "Some REQUIRE-DELETED have not been deleted: {required_deleted:?}" ); + let end_roots = HashSet::<_, RandomState>::from_iter( + get_roots(&proj_dir).context("getting final MINIMIZE-ROOTs")?, + ); + for root in &start_roots { + ensure!( + end_roots.contains(root), + "{root} was not found after minimization" + ); + } + Ok(()) }