qubit-fs-testkit 0.7.0

Reusable provider contract checks for qubit-fs implementations
Documentation
// =============================================================================
//    Copyright (c) 2026 Haixing Hu.
//
//    SPDX-License-Identifier: Apache-2.0
//
//    Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Named phases shared by synchronous and asynchronous contract suites.

/// One independently executable provider contract phase.
///
/// # Examples
///
/// ```
/// use qubit_fs_testkit::FileSystemContract;
///
/// assert!(FileSystemContract::ALL.contains(&FileSystemContract::Properties));
/// assert_eq!(FileSystemContract::ALL.len(), 12);
/// ```
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum FileSystemContract {
    /// Immutable facade properties and fixture path compatibility.
    Properties,
    /// Metadata identity and provider-neutral file kinds.
    Stat,
    /// Reads, ranges, conditions, and checksum validation.
    Read,
    /// Writes, dispositions, conditions, replacement, and abort.
    Write,
    /// Direct, prefixed, metadata-bearing, and paged listings.
    List,
    /// Directory creation and recursive ancestor creation.
    CreateDirectory,
    /// Empty-directory/prefix and symbolic-link representations.
    Representations,
    /// File, directory, conditional, missing-ok, and recursive deletion.
    Delete,
    /// Copy methods, conflicts, statistics, and guarantees.
    Copy,
    /// Rename identity, conflicts, overwrite, and guarantees.
    Rename,
    /// Temporary file and directory lifecycle and persistence.
    TempResources,
    /// Structured public error context.
    ErrorContext,
}

impl FileSystemContract {
    /// Every named contract in dependency-safe execution order.
    pub const ALL: [Self; 12] = [
        Self::Properties,
        Self::Stat,
        Self::Read,
        Self::Write,
        Self::List,
        Self::CreateDirectory,
        Self::Representations,
        Self::Delete,
        Self::Copy,
        Self::Rename,
        Self::TempResources,
        Self::ErrorContext,
    ];
}