From 825870651f40dafb51e191e89479716ca94ad58e Mon Sep 17 00:00:00 2001 From: nils <48135649+Nilstrieb@users.noreply.github.com> Date: Tue, 4 Apr 2023 13:45:14 +0200 Subject: [PATCH] Add require deleted for main body --- full-tests/to-empty-main/src/main.rs | 1 + tests/full_tests.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/full-tests/to-empty-main/src/main.rs b/full-tests/to-empty-main/src/main.rs index 7f80c4e..2d13a58 100644 --- a/full-tests/to-empty-main/src/main.rs +++ b/full-tests/to-empty-main/src/main.rs @@ -9,4 +9,5 @@ fn user(mut map: HashMap<(), ()>) { fn main() { let map = HashMap::new(); user(map); + "~REQUIRE-DELETED main-body"; } diff --git a/tests/full_tests.rs b/tests/full_tests.rs index ed28255..b6e6025 100644 --- a/tests/full_tests.rs +++ b/tests/full_tests.rs @@ -16,6 +16,15 @@ use tempfile::TempDir; #[test] #[cfg_attr(not(unix), ignore = "FIXME: Make this not cursed.")] fn full_tests() -> Result<()> { + let exit = Command::new("cargo") + .arg("build") + .spawn() + .context("spawn: cargo build")? + .wait() + .context("wait: cargo build")?; + + ensure!(exit.success(), "cargo build failed"); + let path = Path::new(file!()) .canonicalize()? .parent()