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
//! Helpers for tests that fake the engine and the game: mock servers and the
//! interfaces they export, and builders of the engine's objects, which this
//! crate's tests share.
//!
//! These exist for tests only, of this crate and of crates built on it, which
//! enable the `_test-support` feature as a dev-dependency. They are not part of
//! the crate's API. The mocks keep their state in thread-locals, which every
//! test starts afresh on its own thread, and leak what they hand the engine
//! wrappers, so it stays valid, at the same address, for the rest of the test
//! process.
//!
//! Helpers that need this crate's private constructors, such as
//! `Entity::from_raw`, only exist in its own unit tests.
pub
/// Leaks a value, so pointers into it stay valid however the test moves what
/// it keeps.
///
/// For tests only.