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
//! The mock-harness leak guard, split out of `super` to keep `mod.rs` under the repo's
//! 1,000-line cap while this module's `mock_url_defaults` sibling adds the zero-edit
//! default that keeps most fixtures out of this guard's way in the first place.
use crateFixture;
use Result;
/// Substrings that only ever appear in e2e mock-server wiring.
///
/// Each is a name the harness itself owns: the environment variables the mock server
/// exports (`MOCK_SERVER_URL`, `MOCK_SERVERS`, the per-fixture `MOCK_SERVER_<ID>`) and
/// the JVM system properties the Java/Kotlin suites read them through.
const MOCK_HARNESS_MARKERS: & = &;
/// Reject a snippet body that carries e2e mock-server scaffolding.
///
/// Snippet bodies are published verbatim into the docs site, so a body that still points
/// at the mock server documents the test harness rather than the library. Every language
/// — built-in or extension-supplied — funnels through `render_snippet_body`, so placing
/// the check here means a new backend inherits the guarantee instead of having to
/// re-derive it. The `Err` carries a typed [`super::MockHarnessLeak`] so the caller can
/// route it to a hard, attributed failure rather than to a coverage gap that a
/// `coverage_exceptions` entry would silently absorb.
pub