Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/bitflags/src/tests/is_all.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / bitflags / src / tests / is_all.rs` 32 lines ยท 749 bytes Raw Blame History 1 use super::*; 2 3 use crate::Flags; 4 5 #[test] 6 fn cases() { 7 case(false, TestFlags::empty(), TestFlags::is_all); 8 case(false, TestFlags::A, TestFlags::is_all); 9 10 case(true, TestFlags::ABC, TestFlags::is_all); 11 12 case( 13 true, 14 TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), 15 TestFlags::is_all, 16 ); 17 18 case(true, TestZero::empty(), TestZero::is_all); 19 20 case(true, TestEmpty::empty(), TestEmpty::is_all); 21 } 22 23 #[track_caller] 24 fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { 25 assert_eq!(expected, inherent(&value), "{:?}.is_all()", value); 26 assert_eq!( 27 expected, 28 Flags::is_all(&value), 29 "Flags::is_all({:?})", 30 value 31 ); 32 }