// SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
// SPDX-License-Identifier: BSD-2-Clause
//! Test some trivial aspects of the timelimit crate.

#![expect(clippy::panic_in_result_fn, reason = "integration test")]
#![expect(clippy::tests_outside_test_module, reason = "integration test")]

use eyre::{Result, eyre};

use timelimit::FEATURES;

#[test]
fn timelimit_in_features() -> Result<()> {
    let version = FEATURES
        .iter()
        .find_map(|&(name, ver)| (name == "timelimit").then_some(ver))
        .ok_or_else(|| eyre!("No 'timelimit' in {FEATURES:?}"))?;
    assert_eq!(version, env!("CARGO_PKG_VERSION"));
    Ok(())
}
