mirror of
https://github.com/fossasia/badgemagic-rs
synced 2025-07-27 05:53:57 +00:00
test: add u8 to Brightness test
This commit is contained in:
parent
5d63cc8e48
commit
8047e719f8
1 changed files with 3 additions and 1 deletions
|
@ -539,7 +539,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn brightness_to_u8() {
|
||||
fn brightness_to_u8_and_back() {
|
||||
const VALID_BRIGHTNESS_VALUES: [(Brightness, u8); 4] = [
|
||||
(Brightness::Full, 0x00),
|
||||
(Brightness::ThreeQuarters, 0x10),
|
||||
|
@ -549,6 +549,8 @@ mod test {
|
|||
|
||||
for (value, raw) in VALID_BRIGHTNESS_VALUES {
|
||||
assert_eq!(u8::from(value), raw);
|
||||
assert_eq!(Brightness::try_from(raw).unwrap(), value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue