Sha256: 11f21323cdca7ff92dd89e09de667dba69e8dce88e2d3e27ea68ace91d15d070

Contents?: true

Size: 750 Bytes

Versions: 8

Compression:

Stored size: 750 Bytes

Contents

use super::*;

use crate::Flags;

#[test]
fn cases() {
    case(true, TestFlags::empty(), TestFlags::is_empty);

    case(false, TestFlags::A, TestFlags::is_empty);
    case(false, TestFlags::ABC, TestFlags::is_empty);
    case(
        false,
        TestFlags::from_bits_retain(1 << 3),
        TestFlags::is_empty,
    );

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

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

#[track_caller]
fn case<T: Flags + std::fmt::Debug>(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) {
    assert_eq!(expected, inherent(&value), "{:?}.is_empty()", value);
    assert_eq!(
        expected,
        Flags::is_empty(&value),
        "Flags::is_empty({:?})",
        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_empty.rs
wasmtime-28.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs
wasmtime-27.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs
wasmtime-26.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs
wasmtime-25.0.2 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs
wasmtime-25.0.1 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs
wasmtime-25.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs
wasmtime-24.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/is_empty.rs