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 / flags.rs

46 lines · 901 bytes Raw Blame History
1use super::*;
2
3use crate::Flags;
4
5#[test]
6fn cases() {
7 let flags = TestFlags::FLAGS
8 .iter()
9 .map(|flag| (flag.name(), flag.value().bits()))
10 .collect::<Vec<_>>();
11
12 assert_eq!(
13 vec![
14 ("A", 1u8),
15 ("B", 1 << 1),
16 ("C", 1 << 2),
17 ("ABC", 1 | 1 << 1 | 1 << 2),
18 ],
19 flags,
20 );
21
22 assert_eq!(0, TestEmpty::FLAGS.iter().count());
23}
24
25mod external {
26 use super::*;
27
28 #[test]
29 fn cases() {
30 let flags = TestExternal::FLAGS
31 .iter()
32 .map(|flag| (flag.name(), flag.value().bits()))
33 .collect::<Vec<_>>();
34
35 assert_eq!(
36 vec![
37 ("A", 1u8),
38 ("B", 1 << 1),
39 ("C", 1 << 2),
40 ("ABC", 1 | 1 << 1 | 1 << 2),
41 ("", !0),
42 ],
43 flags,
44 );
45 }
46}