forked from aeron-io/simple-binary-encoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbaseline_enum_into.rs
More file actions
32 lines (30 loc) · 803 Bytes
/
Copy pathbaseline_enum_into.rs
File metadata and controls
32 lines (30 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use examples_baseline::boost_type::BoostType;
#[test]
fn test_boost_type_from_str() -> Result<(), ()> {
assert_eq!(
<BoostType as Into<u8>>::into(BoostType::TURBO),
84_u8,
"BoostType::TURBO into value"
);
assert_eq!(
<BoostType as Into<u8>>::into(BoostType::SUPERCHARGER),
83_u8,
"BoostType::SUPERCHARGER into value"
);
assert_eq!(
<BoostType as Into<u8>>::into(BoostType::NITROUS),
78_u8,
"BoostType::NITROUS into value"
);
assert_eq!(
<BoostType as Into<u8>>::into(BoostType::KERS),
75_u8,
"BoostType::KERS into value"
);
assert_eq!(
<BoostType as Into<u8>>::into(BoostType::NullVal),
0_u8,
"BoostType::NullVal into value"
);
Ok(())
}