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
49
50
51
//! Exercises the real binary, the same reason `config_flag.rs` does: a wiring mistake between
//! `--theme` and `theme::load` would still leave every unit test in `theme.rs` green, since
//! those call the loader directly rather than through `App::new`.
use ;
/// A `--theme` naming a theme that does not exist must exit non-zero before the TUI ever
/// claims the terminal. `REPON_CONFIG` points the config directory (and so `themes/`) at an
/// empty tempdir, so this cannot pass by accident against a real theme on the machine running
/// it; stdin is `/dev/null` so a wiring bug that ignores the flag and falls through to the TUI
/// fails on the terminal instead, which reads as a different error and still fails the
/// assertion below.
// The same missing name in `config.toml` (not `--theme`) is the other half of theming.md's
// "Five outcomes": it warns and falls back rather than exiting. That is deliberately not
// proven here by launching the real binary: telling "warned and fell back" apart from "failed
// for an unrelated reason" from the outside would mean driving a live TUI with no controlling
// terminal to interact with, which this suite must not do.
// `theme::tests::a_theme_named_in_config_that_does_not_exist_warns_and_falls_back_to_the_compiled_default`
// proves the warning and the fallback colour instead, at the seam `App::new` itself calls.