More number conversion code
100% coverage
This commit is contained in:
@@ -81,3 +81,19 @@ fn split_bytes_u16_join_bytes_u16() {
|
||||
NumberSystemConversion::join_bytes_u16(high as u16, low as u16));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn combine_u8_to_u16() {
|
||||
let test_params: Vec<((u8, u8), u16)> = vec![
|
||||
((0xff, 0x00), 0x00ff),
|
||||
((0x00, 0xff), 0xff00),
|
||||
((0xbe, 0xef), 0xefbe),
|
||||
((0xef, 0xbe), 0xbeef)
|
||||
];
|
||||
|
||||
for ((low, high), base) in test_params {
|
||||
assert_eq!(
|
||||
base, NumberSystemConversion::combine_u8_to_u16(low, high)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user