Sha256: 5fabb9fd0254c64da019149c24063fceff72da3eb4ad73b57c1cc4c04b008364

Contents?: true

Size: 898 Bytes

Versions: 8

Compression:

Stored size: 898 Bytes

Contents

use super::*;

#[test]
fn cases() {
    let mut flags = TestFlags::empty();

    flags.extend(TestFlags::A);

    assert_eq!(TestFlags::A, flags);

    flags.extend(TestFlags::A | TestFlags::B | TestFlags::C);

    assert_eq!(TestFlags::ABC, flags);

    flags.extend(TestFlags::from_bits_retain(1 << 5));

    assert_eq!(TestFlags::ABC | TestFlags::from_bits_retain(1 << 5), flags);
}

mod external {
    use super::*;

    #[test]
    fn cases() {
        let mut flags = TestExternal::empty();

        flags.extend(TestExternal::A);

        assert_eq!(TestExternal::A, flags);

        flags.extend(TestExternal::A | TestExternal::B | TestExternal::C);

        assert_eq!(TestExternal::ABC, flags);

        flags.extend(TestExternal::from_bits_retain(1 << 5));

        assert_eq!(
            TestExternal::ABC | TestExternal::from_bits_retain(1 << 5),
            flags
        );
    }
}

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/extend.rs
wasmtime-28.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs
wasmtime-27.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs
wasmtime-26.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs
wasmtime-25.0.2 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs
wasmtime-25.0.1 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs
wasmtime-25.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs
wasmtime-24.0.0 ./ext/cargo-vendor/bitflags-2.6.0/src/tests/extend.rs