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
52
//! Writing to the user's streams without panicking.
//!
//! The `print!` family panics when the stream behind it fails, which turns a
//! consumer that closed a pipe into an unwind through a command boundary. The
//! two kinds of output `dure` produces want different answers to that, so both
//! are stated here:
//!
//! * **Result output** — the session table, the resume prompt — is what the
//! command was asked for, so a stream that cannot take it fails the command.
//! * **Diagnostics** — verbose notes, warnings, the session banner, the final
//! error message — explain what happened. A stream that cannot take one is
//! not worth failing over, least of all after a session has been committed,
//! so they are best effort.
use Arguments;
use ;
/// Writes result output the command's success depends on.
///
/// # Errors
///
/// Returns the stream failure so the caller can decide what its command should
/// report.
pub
/// Writes a diagnostic, giving up quietly if the stream will not take it.
pub
/// Writes a prompt, without the newline the answer will follow.
///
/// # Errors
///
/// Returns the stream failure: a prompt nobody can see is not worth blocking a
/// read on.
// Writes to the process's own stderr, which no in-process test can observe, so
// a mutation that writes nothing is invisible here. The prompt's wording and
// the decision to ask are covered where they are made.
// Ref: docs/testing.md, "Mutation testing".
pub