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_empty.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_empty.rs` 31 lines ยท 750 bytes Raw Blame History 1 use super::*; 2 3 use crate::Flags; 4 5 #[test] 6 fn cases() { 7 case(true, TestFlags::empty(), TestFlags::is_empty); 8 9 case(false, TestFlags::A, TestFlags::is_empty); 10 case(false, TestFlags::ABC, TestFlags::is_empty); 11 case( 12 false, 13 TestFlags::from_bits_retain(1 << 3), 14 TestFlags::is_empty, 15 ); 16 17 case(true, TestZero::empty(), TestZero::is_empty); 18 19 case(true, TestEmpty::empty(), TestEmpty::is_empty); 20 } 21 22 #[track_caller] 23 fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { 24 assert_eq!(expected, inherent(&value), "{:?}.is_empty()", value); 25 assert_eq!( 26 expected, 27 Flags::is_empty(&value), 28 "Flags::is_empty({:?})", 29 value 30 ); 31 }