Sha256: 683430af4a0e47ec73c737a6908fac5d851bed7c41d47c73a642e96d966aa5ae

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

use super::*;

use crate::Flags;

#[test]
fn cases() {
    case(
        TestFlags::ABC | TestFlags::from_bits_retain(1 << 3),
        TestFlags::ABC,
    );

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

    case(TestZero::all(), TestZero::all());

    case(
        TestFlags::from_bits_retain(1 << 3) | TestFlags::all(),
        TestFlags::all(),
    );
}

#[track_caller]
fn case<T: Flags + std::fmt::Debug>(mut before: T, after: T)
where
    T: std::fmt::Debug + PartialEq + Copy,
{
    before.truncate();
    assert_eq!(before, after, "{:?}.truncate()", before);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/bitflags-2.8.0/src/tests/truncate.rs