target_spec_miette/
fixtures.rs

1// Copyright (c) The cargo-guppy Contributors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Fixtures for target-spec-miette.
5//!
6//! This module contains test fixtures for the target-spec-miette crate,
7//! typically around testing invalid inputs of various kinds.
8//!
9//! These fixtures can be used in downstream crates to verify that bad inputs
10//! are gracefully handled, particularly by showing good error messages. (Good
11//! error messages are part of why this library exists in the first place).
12//!
13//! The target-spec-miette library itself uses them via the
14//! [`datatest-stable`](https://docs.rs/datatest-stable) crate.
15//!
16//! The exact contents of each directory are not part of the semver guarantees,
17//! so using this module is only recommended in tests, and with a checked-in
18//! `Cargo.lock`. A minor update to target-spec-miette may require that your
19//! tests also be updated.
20
21/// A set of invalid custom target JSON specifications.
22pub static CUSTOM_INVALID: include_dir::Dir<'static> =
23    include_dir::include_dir!("$CARGO_MANIFEST_DIR/tests/fixtures/custom-invalid");
24
25/// A set of invalid `cfg` expressions.
26pub static EXPR_INVALID: include_dir::Dir<'static> =
27    include_dir::include_dir!("$CARGO_MANIFEST_DIR/tests/fixtures/expr-invalid");