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/extend.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 / extend.rs` 42 lines ยท 898 bytes Raw Blame History 1 use super::*; 2 3 #[test] 4 fn cases() { 5 let mut flags = TestFlags::empty(); 6 7 flags.extend(TestFlags::A); 8 9 assert_eq!(TestFlags::A, flags); 10 11 flags.extend(TestFlags::A | TestFlags::B | TestFlags::C); 12 13 assert_eq!(TestFlags::ABC, flags); 14 15 flags.extend(TestFlags::from_bits_retain(1 << 5)); 16 17 assert_eq!(TestFlags::ABC | TestFlags::from_bits_retain(1 << 5), flags); 18 } 19 20 mod external { 21 use super::*; 22 23 #[test] 24 fn cases() { 25 let mut flags = TestExternal::empty(); 26 27 flags.extend(TestExternal::A); 28 29 assert_eq!(TestExternal::A, flags); 30 31 flags.extend(TestExternal::A | TestExternal::B | TestExternal::C); 32 33 assert_eq!(TestExternal::ABC, flags); 34 35 flags.extend(TestExternal::from_bits_retain(1 << 5)); 36 37 assert_eq!( 38 TestExternal::ABC | TestExternal::from_bits_retain(1 << 5), 39 flags 40 ); 41 } 42 }