Sha256: b2f11faa7c954bd85c8fb39999e0c37d983cf7895152bc13c7ddde106aa33b6d

Contents?: true

Size: 749 Bytes

Versions: 8

Compression:

Stored size: 749 Bytes

Contents

use super::*;

use crate::Flags;

#[test]
fn cases() {
    case(false, TestFlags::empty(), TestFlags::is_all);
    case(false, TestFlags::A, TestFlags::is_all);

    case(true, TestFlags::ABC, TestFlags::is_all);

    case(
        true,
        TestFlags::ABC | TestFlags::from_bits_retain(1 << 3),
        TestFlags::is_all,
    );

    case(true, TestZero::empty(), TestZero::is_all);

    case(true, TestEmpty::empty(), TestEmpty::is_all);
}

#[track_caller]
fn case<T: Flags + std::fmt::Debug>(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) {
    assert_eq!(expected, inherent(&value), "{:?}.is_all()", value);
    assert_eq!(
        expected,
        Flags::is_all(&value),
        "Flags::is_all({:?})",
        value
    );
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/bitflags-2.8.0/src/tests/is_all.rs
wasmtime-28.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs
wasmtime-27.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs
wasmtime-26.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs
wasmtime-25.0.2 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs
wasmtime-25.0.1 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs
wasmtime-25.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs
wasmtime-24.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_all.rs