1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Trybuild UI tests for the prax macro DSL — computed/virtual field diagnostics.
//!
//! Each `*_fail.rs` fixture under `tests/ui/` exercises one compile-time
//! error path in the macro lowering pipeline. The paired `.stderr` baselines
//! are checked in so CI catches any wording regression.
//!
//! Regenerate baselines after intentional message changes:
//!
//! ```bash
//! TRYBUILD=overwrite cargo test -p prax-codegen --test ui
//! ```
//!
//! The test is gated behind the `ui-tests` feature so that trybuild's
//! rustc-version-sensitive stderr snapshots don't cause noise on every
//! `cargo test` run on different toolchains. Enable explicitly:
//!
//! ```bash
//! cargo test -p prax-codegen --test ui --features ui-tests
//! ```
//!
//! ## PRAX_SCHEMA
//!
//! The macro lowering helpers resolve the schema at proc-macro expansion
//! time via the `PRAX_SCHEMA` env var (or by walking up to `prax.toml`).
//! This harness sets `PRAX_SCHEMA` to the absolute path of the
//! `prax-codegen` fixture schema so that fixtures can invoke the macros
//! without needing a workspace-level schema that includes computed fields.