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
53
54
55
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Outcomes recorded by filesystem contract checks.
/// The observable result of one stable contract check.
///
/// # Examples
///
/// ```
/// use qubit_fs_testkit::ContractCheckOutcome;
///
/// let outcome = ContractCheckOutcome::NotApplicable {
/// reason: "provider does not expose server-side copy".to_owned(),
/// };
/// assert!(matches!(outcome, ContractCheckOutcome::NotApplicable { .. }));
/// ```
#[must_use]
#[non_exhaustive]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ContractCheckOutcome {
/// The provider satisfied the check.
Passed,
/// The provider rejected a request that the contract requires it to reject.
RejectedAsExpected,
/// The check does not apply to this fixture or provider configuration.
NotApplicable {
/// Why this provider or fixture does not expose the scenario.
reason: String,
},
/// The check could not be verified from the fixture's available evidence.
Unverified {
/// Why the suite could not produce independent evidence.
reason: String,
},
/// An optional diagnostic probe was unavailable.
SkippedOptional {
/// Why an optional diagnostic probe was unavailable.
reason: String,
},
/// The executed check violated a contract or its fixture failed.
Failed {
/// A diagnostic describing the failed assertion or operation.
reason: String,
},
/// Execution ended before this registered check could run.
NotRun {
/// Why execution did not reach this check.
reason: String,
},
}