interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / vendor / bitflags / src / tests / all_named.rs

21 lines · 491 bytes Raw Blame History
1use super::*;
2
3use crate::Flags;
4
5#[test]
6fn cases() {
7 case(1 | 1 << 1 | 1 << 2, TestFlags::all_named);
8
9 case(1 | 1 << 1 | 1 << 2, TestExternal::all_named);
10
11 case(0, TestExternalFull::all_named);
12}
13
14#[track_caller]
15fn case<T: Flags>(expected: T::Bits, inherent: impl FnOnce() -> T)
16where
17 <T as Flags>::Bits: std::fmt::Debug + PartialEq,
18{
19 assert_eq!(expected, inherent().bits(), "T::all_named()");
20 assert_eq!(expected, T::all_named().bits(), "Flags::all_named()");
21}